-
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
statistics: do not load unnecessary index statistics (#54060) #59649
base: release-6.5
Are you sure you want to change the base?
statistics: do not load unnecessary index statistics (#54060) #59649
Conversation
@Rustin170506 This PR has conflicts, I have hold it. |
This cherry pick PR is for a release branch and has not yet been approved by triage owners. To merge this cherry pick:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
…dd test for index stats loading Signed-off-by: Rustin170506 <[email protected]>
3f4ac3b
to
e9a6da8
Compare
…detailed guidance Signed-off-by: Rustin170506 <[email protected]>
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.
🔢 Self-check (PR reviewed by myself and ready for feedback.)
/unhold |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: elsa0520, Rustin170506 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
/hold 6.5 doesn't have |
…p unused imports Signed-off-by: Rustin170506 <[email protected]>
Signed-off-by: Rustin170506 <[email protected]>
/unhold |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-6.5 #59649 +/- ##
================================================
Coverage ? 73.6489%
================================================
Files ? 1098
Lines ? 353637
Branches ? 0
================================================
Hits ? 260450
Misses ? 76451
Partials ? 16736 |
This is an automated cherry-pick of #54060
What problem does this PR solve?
Issue Number: close #54022
Problem Summary:
See more at the issue.
A quick summary:
If you have
tidb_opt_objective='determine'
enabled, it will trigger some async stats load for some tables. If there tables histogram isn't in the system, it would cause some problems when we try to load it.What changed and how does it work?
Check that the index statistics are really needed before loading them.
If we don't check it here, it will cause some problems if the index statistics don't exist.
Note: We still don't know why the histogram record for the index is missing. There are some possible issues:
What happened in the test case:
statsHandle.Update(do.InfoSchema())
will load this table into the stats cache. You can test it by breakpoint here:mysql.stats_meta
.https://github.com/hi-rustin/tidb/blob/648fc6386aa9aabb365baf0912f1e18c4ab74d95/pkg/planner/core/logical_plan_builder.go#L4824
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.