-
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) #54087
statistics: do not load unnecessary index statistics (#54060) #54087
Conversation
279e315
to
1d2fde1
Compare
/retest |
/retest |
4 similar comments
/retest |
/retest |
/retest |
/retest |
PR needs rebase. 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. |
Signed-off-by: hi-rustin <[email protected]>
1d2fde1
to
577c819
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qw4990, 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 |
Signed-off-by: Rustin170506 <[email protected]>
Signed-off-by: Rustin170506 <[email protected]>
Signed-off-by: Rustin170506 <[email protected]>
Because it doesn't have tidb_opt_objective, so I removed the test. |
Signed-off-by: Rustin170506 <[email protected]>
/retest |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-7.1 #54087 +/- ##
================================================
Coverage ? 73.6797%
================================================
Files ? 1212
Lines ? 382906
Branches ? 0
================================================
Hits ? 282124
Misses ? 82972
Partials ? 17810 |
/retest |
1 similar comment
/retest |
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.