Skip to content
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: allow the optimizer to cache query plans accessing generated columns by default #51654

Merged
merged 4 commits into from
Mar 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pkg/planner/core/plan_cacheable_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,11 @@ func getMaxParamLimit(sctx PlanContext) int {
func enablePlanCacheForGeneratedCols(sctx PlanContext) bool {
// disable this by default since it's not well tested.
// TODO: complete its test and enable it by default.
hawkingrei marked this conversation as resolved.
Show resolved Hide resolved
defaultVal := true
if sctx == nil || sctx.GetSessionVars() == nil || sctx.GetSessionVars().GetOptimizerFixControlMap() == nil {
return false
return defaultVal
}
return fixcontrol.GetBoolWithDefault(sctx.GetSessionVars().GetOptimizerFixControlMap(), fixcontrol.Fix45798, false)
return fixcontrol.GetBoolWithDefault(sctx.GetSessionVars().GetOptimizerFixControlMap(), fixcontrol.Fix45798, defaultVal)
}

// checkTableCacheable checks whether a query accessing this table is cacheable.
Expand Down