You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
REMOVE TABLE haircut;
UPDATE haircut:1 CONTENT {
year: 2022,
shampoo: "green"
};
UPDATE haircut:1 CONTENT {
year: 2022,
};
DEFINE INDEX timeIndex ON TABLE haircut COLUMNS year;
SELECT * FROM haircut WHERE year = 2022 EXPLAIN; // uses index as expected
SELECT * FROM haircut WHERE year = 2022 AND shampoo = "green" EXPLAIN; // uses index as expected
SELECT * FROM haircut WHERE year = 2022 AND shampoo IS NONE EXPLAIN; // does NOT use index
SELECT * FROM haircut WHERE year = 2022 AND object::len(shampoo) = 0 EXPLAIN; // does NOT use index
Steps to reproduce
Execute the code above. You will get the following:
I suspect that the INDEX qualifications are applied to all the conditions instead of being applied only to the conditions that are relevant to the index.
ioannist
changed the title
Bug: 'Unsupported value' causes INDEX to not be used
Bug: 'Unsupported value' in no-index WHERE condition, causes INDEX to not be used
May 15, 2024
Describe the bug
Steps to reproduce
Execute the code above. You will get the following:
Expected behaviour
The last two SELECTs should use the index too.
SurrealDB version
1.5
Contact Details
No response
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: