New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Compound indexes not applied in Queries #2900
Labels
bug
Something isn't working
topic:indexing
This is related to indexing and full-text search
topic:surrealql
This is related to the SurrealQL query language
Comments
kearfy
added
topic:surrealql
This is related to the SurrealQL query language
topic:indexing
This is related to indexing and full-text search
labels
Jan 16, 2024
Hit the same issue. I have a file table where I index the storage name and parent path and it doesn't seem to use index. SELECT name, size, mtime, parent, storage FROM file WHERE storage='Downloads' AND parent='/' |
2 tasks
Would you consider creating two indexes? Eventually the compound index will work on the AND query (we are currently working on it) SELECT name FROM student WHERE subject = "English" AND grade = "A" EXPLAIN; For the OR query you will have to create two indexes: DEFINE INDEX subject_idx ON student FIELDS subject;
DEFINE INDEX grade_idx ON student FIELDS grade;
SELECT name FROM student WHERE subject = "English" OR grade = "A" EXPLAIN; [
{
"detail": {
"plan": {
"index": "subject_idx",
"operator": "=",
"value": "English"
},
"table": "student"
},
"operation": "Iterate Index"
},
{
"detail": {
"plan": {
"index": "grade_idx",
"operator": "=",
"value": "A"
},
"table": "student"
},
"operation": "Iterate Index"
},
{
"detail": {
"type": "Store"
},
"operation": "Collector"
}
] |
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
topic:indexing
This is related to indexing and full-text search
topic:surrealql
This is related to the SurrealQL query language
Describe the bug
Compound indexes not applied in Queries
Steps to reproduce
The result of last 4 queries:
Kindly please apply the index wherever it is needed.
I am doing migration work. due to not applying indexes, it took a long time.
if it goes like this, it takes many months to migrate our db.
Expected behaviour
Kindly please apply indexes wherever it is needed.
SurrealDB version
surreal 1.0.0
Contact Details
No response
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: