Comments (3)
Hi @matcho!
This indeed looks a little bit strange. I will investigate it and then get back to you.
from arangodb.
Hi @matcho !
This behavior is expected since your index doesn't contain field _key
: Therefore it should be materialized directly from the storage. As a result, it is way slower as expected.
Could you please try to add _key
field to primarySort as well? Here is the documentation about how such view with 2 fields in primarySort could be created: https://docs.arangodb.com/3.11/index-and-search/arangosearch/performance/#primary-sort-order
from arangodb.
Thank you for your answer.
I understand that using a 2-field primarySort
would certainly work − we'll try that as soon as possible, although it seems that primarySort cannot be changed on an existing view : const error: /primarySort must be equal to constant. Schema: {"allowedValue":[{"field":"date_obs","asc":false}]}
, and view has to be re-created from scratch (no big deal).
What still seems strange is that returning a projection that includes _key
is very fast, although _key
is not an indexed field in the view : the following query runs in 165ms !
FOR o in obs_geo_view
SEARCH ANALYZER(GEO_CONTAINS(GEO_POLYGON(france), o.geoloc), "geopoint_pn")
SORT o.date_obs DESC
LIMIT 20000, 1000
RETURN {
date_obs: o.date_obs,
_key: o._key
}
Once the 1000 resulting items, including date_obs
and _key
fields, are returned so fast, what keeps AQL from re-sorting them in-memory ? Sorting 1000 items should take almost no time. In queries mentioned in the original post above, it seems that the optimizer forces the second SORT
statement to be executed before pagination, which is not what is expressed in the AQL query, especially query 3 with the sub-query.
So it still looks like an optimizer / AQL issue to me. We should be able to apply a secondary sort after pagination without modifying the view's primarySort
. Besides, what if we want to sort after pagination on different fields, in different cases ? We would then have to build multiple views with a different primarySort
in each of them, which doesn't seem reasonable.
Thank you
from arangodb.
Related Issues (20)
- Feature Request: Seperate query from data for easier and safer operations HOT 3
- How to listen to changes in Arango Collection HOT 1
- RocksDB encountered a background error during a compaction operation: HOT 2
- GraphAR export / import
- optimizer should consider projections and stored values when selecting indexes HOT 5
- Render large graph - rendering bug - select graph traversal order
- Fedora 40 fatal error when login HOT 4
- Update leader election failed. error="context deadline exceeded": Deployment Using the ArangoDB Starter in Docker
- Primary Sort ArangoSearch is not flexible, What's other way do with sort in ArangoSearch HOT 18
- Documentation conflict. Is Active Failover mode deprecated? HOT 2
- InvalidImageName HOT 2
- How to join arangodb community slack channel? HOT 1
- Search-Alias View can't search on field type array HOT 3
- Arangorestore error 'Connection closed by remote'
- Understanding how switching a license works
- [BUG] mergeObjects does not effect the root document HOT 2
- Number Overflow when using AVG HOT 1
- Can't add inverted indexes contains same sort fields of other collections to a view search-alias HOT 1
- Can't add a index collection contains primary sort different config primary sort of previous indexes to a search-alias view HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arangodb.