statistics: merge partition-level TopN to global-level TopN#22433
Merged
qw4990 merged 18 commits intopingcap:masterfrom Feb 19, 2021
Merged
statistics: merge partition-level TopN to global-level TopN#22433qw4990 merged 18 commits intopingcap:masterfrom
qw4990 merged 18 commits intopingcap:masterfrom
Conversation
Contributor
Author
|
/label sig/planner, component/statistics, type/enhancement |
Contributor
|
/cc @rebelice |
Contributor
Author
|
/cc @qw4990 |
rebelice
reviewed
Feb 18, 2021
rebelice
reviewed
Feb 19, 2021
statistics/handle/handle.go
Outdated
|
|
||
| if len(popedTopN) != 0 { | ||
| popedTopNHg := statistics.NewHistogram(allID[i], 0, 0, 0, allFieldType[i], 0, 0) | ||
| popedTopNHg.AddIdxVals(popedTopN) |
Contributor
There was a problem hiding this comment.
There seems to be a problem with the AddIdxVals. If the value is greater or less than the boundaries of all buckets, it cannot be inserted.
qw4990
reviewed
Feb 19, 2021
qw4990
reviewed
Feb 19, 2021
qw4990
reviewed
Feb 19, 2021
qw4990
reviewed
Feb 19, 2021
Comment on lines
+640
to
+646
| totCnt := uint64(0) | ||
| for _, topN := range topNs { | ||
| totCnt += topN.TotalCount() | ||
| } | ||
| if totCnt == 0 { | ||
| return nil, nil | ||
| } |
Contributor
There was a problem hiding this comment.
Why do we need to check this? It seems unnecessary.
qw4990
reviewed
Feb 19, 2021
Contributor
Author
|
@qw4990 Update. PTAL |
Contributor
Author
|
/run-all-tests |
ti-srebot
previously approved these changes
Feb 19, 2021
Contributor
Author
|
/merge |
Contributor
|
/run-all-tests |
Contributor
|
@Reminiscent merge failed. |
Contributor
Author
|
/run-all-tests |
Contributor
Author
|
/run-all-tests |
qw4990
approved these changes
Feb 19, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: related: #18551
Problem Summary:
We introduce two-level statistics for the partition tables. This PR is part of it and is used to merge topN.
What is changed and how it works?
Proposal (in Chinese)
merge multi topN to a new topN.
Related changes
pingcap/docs/pingcap/docs-cn:Check List
Tests
Release note