-
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
*: fix the estimation error on normal column when collation enabled #18104
Conversation
/rebuild |
Codecov Report
@@ Coverage Diff @@
## master #18104 +/- ##
===========================================
Coverage 79.5315% 79.5315%
===========================================
Files 535 535
Lines 144725 144725
===========================================
Hits 115102 115102
Misses 20353 20353
Partials 9270 9270 |
/run-integration-common-test tikv=pr/8105 |
/run-common-test |
/run-integration-common-test tikv=pr/8105 |
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 |
/run-all-tests tikv=pr/8105 |
/run-integration-br-tests tikv=pr/8105 |
/run-integration-br-tests tikv=pr/8105 |
/run-integration-br-tests tikv=pr/8105 tiflash=master |
/run-unit-test |
/run-unit-test |
1 similar comment
/run-unit-test |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #18311 |
What problem does this PR solve?
Issue Number: close #14689
Problem Summary:
For index, its key is already generated by the sort key by the collation information. And when we query the index estimation, we also use
EncodeKey
which will first convert the column value to sort key then encode it. So it's automatically correct for index without any additional change.But for a column, when sampling we use its original value thus when query it with count-min sketch or histogram. We'll get a wrong answer since the order information is lost.
What is changed and how it works?
What's Changed:
For tikv part, use the sort key generated by the collation as the sampling data. tikv/tikv#8105
And when querying, convert to sort key first.
How it Works:
Related changes
Check List
Tests
Side effects
Release note