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
tidb_query: fix analyze column inconsistent behavior betwen TiDB and TiKV (#6055) #6096
Merged
Conversation
This file contains 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
Signed-off-by: Lonng <heng@lonng.org>
/run-all-tests |
sre-bot
added
sig/coprocessor
SIG: Coprocessor
type/cherry-pick
Type: PR - Cherry pick
labels
Nov 28, 2019
lonng
approved these changes
Nov 28, 2019
breezewish
approved these changes
Nov 28, 2019
/merge |
Sorry @iosmanthus, you don't have permission to trigger auto merge event on this branch. |
iosmanthus
approved these changes
Dec 2, 2019
AndreMouche
approved these changes
Dec 20, 2019
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 6244 |
/run-all-tests |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
sig/coprocessor
SIG: Coprocessor
status/can-merge
Status: Can merge to base branch
type/cherry-pick
Type: PR - Cherry pick
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.
cherry-pick #6055 to release-3.0
Signed-off-by: Lonng heng@lonng.org
What have you changed?
The TiKV has inconsistent behavior with TiDB about analyzing column. see:
https://github.com/pingcap/tidb/blob/eae41adc0cd4a617d792a8bb426033c433a70527/statistics/sample.go#L173
The TiDB assumes samples will keep order with the original data order if the samples count greater than the
max_sample_count
. But TiKV replaces the original data if the index conflict, which breaks the assumption.According to the TiDB logic, we should remove the item which index conflected, and append the new item to the samples.
What is the type of the changes?
Pick one of the following and delete the others:
How is the PR tested?
Please select the tests that you ran to verify your changes: