-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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: fix wrong PointGet / TableDual plan reused in plan cache (#23238) #24043
planner: fix wrong PointGet / TableDual plan reused in plan cache (#23238) #24043
Conversation
/run-all-tests |
@eurekaka you're already a collaborator in bot's repo. |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
7b0eae8
to
bce34f6
Compare
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
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 15e10c9
|
cherry-pick #23238 to release-5.0
You can switch your code base to this Pull Request by using git-extras:
# In tidb repo: git pr https://github.com/pingcap/tidb/pull/24043
After apply modifications, you can push your change to this PR via:
What problem does this PR solve?
Issue Number: close #23187
close #23144
close #23304
close #23290
Problem Summary:
Planner cannot find a plan for a query while it indeed can.
What is changed and how it works?
What's Changed:
DeriveStats
and only keep the TableDual / PointGet path, we mark this plan as not cacheable;How it Works:
These plans have strong dependency on the param values, i.e, if the values change, those plans may lead to wrong query results.
Related changes
N/A
Check List
Tests
Side effects
prepare stmt from 'select * from t1, t2 where t1.a > 9 and t1.a < 0 and t2.a > ? and t1.b = t2.b'
cannot be cached then, but it is safe actually.Release note