-
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
plan: make query on partition table not cacheable (#16375) #16723
plan: make query on partition table not cacheable (#16375) #16723
Conversation
/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
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.
@imtbkcat build failed, PTAL
[2020-04-22T14:00:09.440Z] # github.com/pingcap/tidb/planner/core
[2020-04-22T14:00:09.440Z] planner/core/common_plans.go:338:10: e.setFoundInPlanCache undefined (type *Execute has no field or method setFoundInPlanCache)
[2020-04-22T14:00:09.440Z] make: *** [importer] Error 2
[2020-04-22T14:00:09.696Z] # github.com/pingcap/tidb/planner/core
[2020-04-22T14:00:09.696Z] planner/core/common_plans.go:338:10: e.setFoundInPlanCache undefined (type *Execute has no field or method setFoundInPlanCache)
[2020-04-22T14:00:09.696Z] # github.com/pingcap/tidb/planner/core
[2020-04-22T14:00:09.696Z] planner/core/common_plans.go:338:10: e.setFoundInPlanCache undefined (type *Execute has no field or method setFoundInPlanCache)
PTAL @zz-jason |
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
/run-all-tests |
@sre-bot merge failed. |
cherry-pick #16375 to release-4.0
What problem does this PR solve?
Issue Number: close #16364
Problem Summary:
#15697 will check whether plan is a query on partition table and will pass by if is true. But there is still some problems bring by
stmtCtx.UseCache
. If a plan isCacheable
,stmtCtx.UseCache
is set totrue
. So thesimpleRewriter
has different output compare with not cached plan.For example, in #16364. If prepare-plan-cache is on, although query on partition table is not cached, it has different plan.
not use cache:
lt(test.employees.id, 3)
use cache:
lt(cast(test.employees.id), 3)
this small change in
rewriter
cause partition pruning fail.What is changed and how it works?
Proposal: xxx
What's Changed:
add partition check in
Cacheable
function rather thangetPhysicalPlan
Related changes
Check List
Tests
Side effects
Release note