-
Notifications
You must be signed in to change notification settings - Fork 5.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
planner: avoid using index_merge when there are multiple table filters #22122
Conversation
/run-all-tests |
for _, path := range partialPaths { | ||
// IndexMerge should not be used when the SQL is like 'select x from t WHERE (key1=1 AND key2=2) OR (key1=4 AND key3=6);'. | ||
// Check issue https://github.com/pingcap/tidb/issues/22105 for details. |
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.
Actually we can use IndexMerge for this case, as long as we keep the whole filter (key1=1 and key2=2) or (key1=4 and key3=6)
in the selection, that should be the original intention of #20425.
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.
LGTM. We can fix the bug quickly by this PR and optimize the plan later.
1063970
to
5218556
Compare
/run-all-tests |
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.
LGTM
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #22124 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.0-rc in PR #22125 |
What problem does this PR solve?
Issue Number: close #22105
Problem Summary:
What is changed and how it works?
Proposal: xxx
What's Changed:
Avoid using index merge when there are multiple table filters.
How it Works:
Related changes
Check List
Tests
Side effects
N/A
Release note