-
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: add bucket ndv for index histogram #20580
Conversation
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
Please follow PR Title Format:
Or if the count of mainly changed packages are more than 3, use
|
@winoros could you share some testing results about the selectivity estimation accuracy improvements? |
148f1b5
to
b4bdd72
Compare
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
… into bucket-ndv-index-hist
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
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
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
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
@winoros merge failed. |
/run-all-tests tidb-test=pr/1139 |
/run-tics-test |
What problem does this PR solve?
Issue Number: close #xxx
Problem Summary:
add bucket ndv for hist to improve its accuracy.
What is changed and how it works?
Proposal: xxx
What's Changed:
Add new stats version number to solve compability problem. if the hist is in old version number, we estimate row count using the old way.
When build index hist, record the NDV. And update the NDV when merging buckets.
When estimate row counts, if the bucket ndv is zero, fallback to cm sketch currently.(After @qw4990 decouple the cmsketch and ndv. This part will be changed to use topn to estimate.).
When updating feedback, collect ndv infomation at coprocessor's reader. And use it to update the current histogram.
When dumping feedback, since the estimation logic is changed, just dump the index's feedback instead of the original way.
How it Works:
Check List
Tests
Side effects
Release note
No release note