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
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>
What does this PR do? |
lonng
changed the title
tidb_query: fix analyze column
tidb_query: fix analyze column inconsistent behavior betwen TiDB and TiKV
Nov 27, 2019
@eurekaka PTAL |
breezewish
approved these changes
Nov 27, 2019
iosmanthus
approved these changes
Nov 27, 2019
/merge |
Your auto merge job has been accepted, waiting for 5974 |
/run-all-tests |
Should this be cherry-picked to 3.0? |
lonng
added
needs-cherry-pick-release-3.0
Type: Need cherry pick to release 3.0
needs-cherry-pick-release-3.1
Type: Need cherry pick to release 3.1
labels
Nov 28, 2019
/run-cherry-picker |
cherry pick to release-3.1 in PR #6095 |
cherry pick to release-3.0 in PR #6096 |
hawkingrei
pushed a commit
to hawkingrei/tikv
that referenced
this pull request
Dec 1, 2019
…TiKV (tikv#6055) Signed-off-by: Lonng <heng@lonng.org>
zhang555
pushed a commit
to zhang555/tikv
that referenced
this pull request
Dec 16, 2019
…TiKV (tikv#6055) Signed-off-by: Lonng <heng@lonng.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
needs-cherry-pick-release-3.0
Type: Need cherry pick to release 3.0
needs-cherry-pick-release-3.1
Type: Need cherry pick to release 3.1
sig/coprocessor
SIG: Coprocessor
status/can-merge
Status: Can merge to base branch
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.
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: