-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
opt: inverted indexes always require index join, even when no reads from primary index required #46765
Comments
CC @mgartner |
@RaduBerinde I'll take a look. |
Note that #53586 only eliminates unnecessary IndexJoins when they are inside Projects. I think this covers all cases of unnecessary IndexJoins after inverted index scans—I couldn't think of a case where a non-Project would wrap an unnecesary IndexJoin. But there are still cases of unnecessary IndexJoins after partial index scans. I've created a ticket here to track: #54588 |
What about index joins when the only columns needed from the primary index are the primary key columns, which are already in the inverted index. Do we eliminate those? |
Yep, that case is fixed (as is the case described in this issue):
|
Currently, inverted index searches always seem to require an index join, even if there are no requested values from the table. This is unoptimal, and unless I'm forgetting a special property of inverted indexes, seems unnecessary.
Can we remove the index join if there are no projections involving columns? This improves the case of checking for existence within a collection on a table.
Prompted by a forum question: https://forum.cockroachlabs.com/t/checking-value-existence-in-index/3578
The text was updated successfully, but these errors were encountered: