Replies: 1 comment
-
Hi, Yes in 3.x (and 3.2.x) the query engine has a better handling of indexes compared to the 2.2.x, that should cover also this case. Regards |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This query takes about 2.5 seconds and reads 200000+ records:
This query takes 0.06 seconds and reads 1 record:
The unique, compound index includes __instance, __class, and __key only, in that order. The difference in the second example is that those fields are grouped by parenthesis, with hash being separate; while the first example just lists all four fields.
This is running on 2.2.x. I'm surprised that the query optimizer wouldn't naturally use the index to find the first list of candidates before checking the hash field, but it doesn't appear to. I know that 2.2.x is old, so my real question is if this is a known issue and if it has been fixed in 3.x.
Beta Was this translation helpful? Give feedback.
All reactions