Comments (18)
Hi @son2408!
Unfortunately, it is only possible to gain performance advantage for the order, which is specified in PrimarySort definition.
from arangodb.
Hello @son2408 !
Unfortunately, you can specify Primary Sort fields/order only during view creation:
You can only set the primarySort option and the related primarySortCompression and primarySortCache options on View creation.
Here is the documentation page: https://docs.arangodb.com/3.11/index-and-search/arangosearch/performance/#primary-sort-order
To solve your problem, you can switch to the recently implemented Inverted Index and Search Alias View: https://docs.arangodb.com/3.11/index-and-search/arangosearch/search-alias-views-reference/#how-to-use-search-alias-views.
With these new functionality one can achieve your desired scenario:
- Create an Inverted Index for the new collection with required Primary Sort settings.
- Add this index to Search Alias View - now previously added indexes are not affected.
- After adding index you can query view.
If you have any further questions feel free to ask them as well!
from arangodb.
@alexbakharew thanks you
from arangodb.
Hello @alexbakharew I can't add new index of a collection into search-alias exists. if I upadate indexes property, it's sync all, I don't expect this.
from arangodb.
@alexbakharew how to do it ?
from arangodb.
I have a search-alias with index "idx_1800260331957649408" with collection "a"
from arangodb.
Now, I want add new index of collection b into search-alias "r" exists. I don't affect indexes before :(
from arangodb.
@alexbakharew by your suggest, I request api update search-alias with this body?
"indexes": [
{
"collection": "a",
"index": "idx_1800260331957649408",
"operation": "string"
},
{
"collection": "b",
"index": "idx_1800288305630150656",
"operation": "string"
}
]
from arangodb.
Hello @son2408
if I upadate indexes property, it's sync all, I don't expect this.
Do you mean that the update of the search-alias view with exactly one new index has the same execution time as creating arangosearch view for all collections?
from arangodb.
"indexes": [
{
"collection": "a",
"index": "idx_1800260331957649408",
"operation": "string"
},
{
"collection": "b",
"index": "idx_1800288305630150656",
"operation": "string"
}
]
"operation": "string" is incorrect here. https://docs.arangodb.com/3.11/index-and-search/arangosearch/search-alias-views-reference/#view-modification
You can use either "add" or "del". Default value is "add". So in your case you can simply omit it.
from arangodb.
I receive a message error, do you explain it for me, thanks ?
from arangodb.
@son2408 I suspect that in these 2 indexes you have different primary sort orders. So the order should be the same in all indexes.
If you mix directions in the primary sort order, the inverted index cannot be utilized for fully optimizing out a matching SORT operation if you use the inverted index standalone.
from arangodb.
@alexbakharew I want create sort order both asc and desc for a field in Inverted Index. Therefore it causes the above error. If only choose one sort order, I think this it's not reasonable.
from arangodb.
@alexbakharew. I try create sort order both asc and desc on a field, but i see it only work with asc :(
from arangodb.
Hi @son2408!
I want create sort order both asc and desc for a field in Inverted Index. Therefore it causes the above error. If only choose one sort order, I think this it's not reasonable.
Unfortunately, I wasn't able to reproduce this error by specifying different sorting order for the same field. I got this error when I tried to create a view with indexes which have different sorting orders.
Could you please provide collection, indexes and view definitions for more detailed info?
I try create sort order both asc and desc on a field, but i see it only work with asc :(
Under the hood in the index there is no data duplication. It means that we store documents in index only once and apply sorting orders which you have defined in index definition. As a result, your documents in index will be sorted either in ascending or in decreasing order.
from arangodb.
Hello @alexbakharew. If a field can sort asc or desc, should I index sort this field by your suggestion?
from arangodb.
@alexbakharew In fact, when client use my application, they want view oldest or lastest data by time. I can't force them only once direct sort
from arangodb.
@alexbakharew How to index sort a field that I can query sort either in ascending or in decreasing order ? If with a field I create two indexes, one for ascending one for decreasing and if i need index sort for 10 fields i will create 20 indexes. I think this is a bad idea
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
- Documentation conflict. Is Active Failover mode deprecated? HOT 2
- ArangoSearch view: sort after pagination breaks view performance HOT 3
- 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
- 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.