-
Notifications
You must be signed in to change notification settings - Fork 6k
statistics: only analyze one index at a time #51785
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
Conversation
Signed-off-by: hi-rustin <[email protected]>
Signed-off-by: hi-rustin <[email protected]>
Signed-off-by: hi-rustin <[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.)
@@ -204,6 +204,7 @@ func (j *DynamicPartitionedTableAnalysisJob) analyzePartitionIndexes( | |||
) { | |||
analyzePartitionBatchSize := int(variable.AutoAnalyzePartitionBatchSize.Load()) | |||
|
|||
OnlyPickOneIndex: |
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.
The reasons I use a label here are:
- I can't easily retrieve the first kv from a map, so I prefer to use a for loop.
- If I directly return from the inner loop, I will get an SA4004 warning from the static check.
So I think a named label would help.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #51785 +/- ##
================================================
+ Coverage 70.7335% 72.8345% +2.1009%
================================================
Files 1476 1476
Lines 437532 437758 +226
================================================
+ Hits 309482 318839 +9357
+ Misses 108659 98910 -9749
- Partials 19391 20009 +618
Flags with carried forward coverage won't be shown. Click here to find out more.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hawkingrei, winoros 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:
|
What problem does this PR solve?
Issue Number: close #51775
Problem Summary:
We are analyzing the same table multiple times because when an index is analyzed in TiDB, it also analyzes other indexes and columns.
What changed and how does it work?
Only one index should be analyzed. Multiple indexes are stored to track the total analyzed indexes, even if only one is triggered.
You can check the tests to see what is the correct behavior.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.