-
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
*: table partition dynamic prune mode with Physical Table ID from unistore #31634
Conversation
Table Partition Dynamic Prune Mode uses a single TableReader meaning it is not currently possible to know which partition a row/record comes from. By adding ExtraPhysTblID column this can be used when the row needs the Physical Table ID (partition id) for SelectLock or checking current transaction buffer (if the row has been changed/deleted).
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-unit-test |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/0700f749f3e08dde22e133232360159201a1f1d9 |
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.
Overall, I like the idea behind this PR.
It will not change the kvproto, and the modification of TiKV is not too much.
TODO: Check if UseDynamicPruneMode() and only then add ExtraPhysTblIDCol in logic plan In UnionScan/SelectLockExec if partition and not ExtraPhysTblIDCol then use GetPhysicalId
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 718067c
|
/run-mysql-test pr=1601 |
/run-unit-test |
/run-mysql-test tidb-test=pr/1601 |
What problem does this PR solve?
Issue Number: close #29851
Problem Summary:
What is changed and how it works?
The current issue with dynamic prune mode is that it uses a single TableReader which loses context which partition (physical table id) the different rows comes from, which is needed for SelectLock (SELECT FOR UPDATE) and comparison with the Transaction buffer.
By adding a virtual column with ExtraPhysTblID the engine can extract the physical table ID from the KV key that is read and append it to the row/chunk data.
Check List
Tests
Side effects
Documentation
Release note