-
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
*: speed up the operation of "admin check table" #8572
Conversation
Really impressive. |
Please fix ci. |
/run-all-tests |
/run-unit-test |
OK, great work! I need more time to review it. |
/run-unit-test |
@zimulala Please address comments |
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.
This pr is too long, needing time to deliberate. By now it's LGTM
/run-all-tests |
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
/run-all-tests |
@zimulala merge failed. |
/run-unit-test |
cherry pick to release-3.0 failed |
What problem does this PR solve?
Reduce the execution time of this operation of "admin check table".
What is changed and how it works?
compare the result of "select count() from table" and "select count() from table use index(idx)"
table count == index count
We will check the records with the
IndexLookUpReader
method of all indexes.table count > index count
We will use the current index's
checkTableRecord
to check the records.table count < index count
We will use the current index's IndexLookUpReader to check the records.
Using 3 TiKV(8 Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz), 1 PD, 1 TiDB , the servers of TiKV and TiDB are not on a server.
before vs after
Executing this operation with old code takes too long, so the following only tests the new code
Check List
Tests
Side effects
Related changes
This change is