-
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, infoschema : add columns about plan cache in 'performance_schema.events_statements_summary_by_digest' (#16476) #17493
Conversation
…hema.events_statements_summary_by_digest' (pingcap#16476)
/run-all-tests |
//plan cache | ||
if sei.PlanInCache { | ||
ssElement.planInCache = true | ||
ssElement.planCacheHits += 1 | ||
} | ||
|
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.
It seems planCacheHits
is enough. Why add planInCache
?
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.
@djshow832 If users use last_plan_in_cache
, there is no way to view historical plan cache hit information. Add plan_in_cache
, then you can record the last plan cache hit information for each sql_digest
.
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.
LGTM
/run-all-tests |
cherry-pick #16476 to release-4.0
What problem does this PR solve?
Issue Number: close #16217
Problem Summary:
What is changed and how it works?
What's Changed:
plan_cache_hits
andplan_in_cache
) are added toinformation_schema.statements_summary
StatementContext
to record plan cache info.How it Works:
plan_in_cache
indicates whether the last statement in these statements hit plan cache.plan_cache_hits
indicates the number of times these statements hit plan cache.Related changes
pingcap/docs
/pingcap/docs-cn
:Tests
Side effects
Release note
select digest_text, plan_cache_hits, plan_in_cache from information_schema.statements_summary