-
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: respect NO_INDEX_JOIN flag #85843
Conversation
Prior to this commit, it was possible that the optimizer could produce a plan with an index join even if the user hinted that index joins should be avoided by using the NO_INDEX_JOIN hint. This commit fixes that oversight, and we no longer plan an index join in this case. This commit also adds assertions that an index join is not planned if NO_INDEX_JOIN is used to prevent this bug from recurring. Fixes cockroachdb#85841 Release note (bug fix): Fixed an issue where the NO_INDEX_JOIN hint could be ignored by the optimizer in some cases, causing it to create a query plan with an index join.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 8 of 8 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @mgartner)
TFTR! bors r+ |
This PR was included in a batch that was canceled, it will be automatically retried |
Build failed (retrying...): |
Build succeeded: |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from c3da919 to blathers/backport-release-21.2-85843: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 21.2.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Prior to this commit, it was possible that the optimizer could
produce a plan with an index join even if the user hinted that
index joins should be avoided by using the
NO_INDEX_JOIN
hint. Thiscommit fixes that oversight, and we no longer plan an index join
in this case. This commit also adds assertions that an index join
is not planned if
NO_INDEX_JOIN
is used to prevent this bug fromrecurring.
Fixes #85841
Release note (bug fix): Fixed an issue where the
NO_INDEX_JOIN
hint could be ignored by the optimizer in some cases, causing it
to create a query plan with an index join.