-
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
statistics: skip reading mysql.stats_histograms if cached stats is up-to-date #24175
Conversation
/run-all-tests |
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.
This change LGTM, reading meta in 3 leases should not cost too much
/lgtm |
@crazycs520: In response to this:
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 ti-community-infra/tichi repository. |
The test Background: tidb/statistics/handle/handle.go Lines 837 to 839 in 59b99ce
When loading stats, we only load columns/indexes which exist in the infoschema. The test case is basically asserting that when infoschema in a tidb get updated (added a column in the test case) but stats in the tikv doesn't change (which means no Before this PR, this is achieved by this redundant loading of stats that already has I think changes in this PR are reasonable, but we still need to decide what's the correct behavior when scenarios similar to the test case happen. |
/run-all-tests |
/run-all-tests |
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
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
/run-integration-common-test |
/run-unit-test |
1 similar comment
/run-unit-test |
cherry pick to release-5.0 in PR #24317 |
/run-cherry-picker |
cherry pick to release-4.0 failed |
cherry pick to release-4.0 in PR #24352 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
What problem does this PR solve?
Issue Number: close #24096
Problem Summary:
There is no write in the cluster, while mysql.stats_histograms is repeatedly read.
What is changed and how it works?
What's Changed:
Skip reading
mysql.stats_histograms
if the cached stats is up-to-date.Related changes
N/A
Check List
Tests
Side effects
N/A
Release note