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: record the reason why a query can't hit the plan cache in statements_summary table #50618

Closed
qw4990 opened this issue Jan 22, 2024 · 0 comments · Fixed by #52725
Closed

Comments

@qw4990
Copy link
Contributor

qw4990 commented Jan 22, 2024

Enhancement

User Story: In PoC, after a round of testing, the user wants to know which queries cannot hit the plan cache and their reasons to help them optimize the plan cache hit ratio further, but our current diagnosis information is not enough for this.

A graceful and simple method to implement this is to record the un-cacheable reason in the statements_summary table, then the user can query this table to identify the reason, for example:

select query_text, exec_count, uncacheable_reason 
from statements_summary 
where prepared=1 and uncacheable_reason!="" 
order by exec_count limit 100;
@qw4990 qw4990 added type/enhancement The issue or PR belongs to an enhancement. sig/planner SIG: Planner epic/plan-cache labels Jan 22, 2024
@qw4990 qw4990 changed the title planner: a new view to diagnose whey queries cannot hit the plan cache planner: record the reason why a query can't hit the plan cache in statements_summary table Apr 18, 2024
ti-chi-bot bot pushed a commit that referenced this issue Apr 22, 2024
ti-chi-bot bot pushed a commit that referenced this issue Apr 23, 2024
ti-chi-bot bot pushed a commit that referenced this issue May 6, 2024
3AceShowHand pushed a commit to 3AceShowHand/tidb that referenced this issue May 7, 2024
terry1purcell pushed a commit to terry1purcell/tidb that referenced this issue May 17, 2024
terry1purcell pushed a commit to terry1purcell/tidb that referenced this issue May 17, 2024
terry1purcell pushed a commit to terry1purcell/tidb that referenced this issue May 17, 2024
RidRisR pushed a commit to RidRisR/tidb that referenced this issue May 23, 2024
ti-chi-bot bot pushed a commit that referenced this issue Jun 26, 2024
…CACHE_UNQUALIFIED_LAST_REASON` in statement_summary (#54218)

ref #50618
ti-chi-bot bot pushed a commit that referenced this issue Jun 27, 2024
…CACHE_UNQUALIFIED_LAST_REASON` in statement_summary (#54218) (#54238)

ref #50618
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants