-
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
ddl: add syntax for setting the cache step of auto id explicitly. #15409
Conversation
This PR need parser merged first |
Codecov Report
@@ Coverage Diff @@
## master #15409 +/- ##
===========================================
Coverage 80.6188% 80.6188%
===========================================
Files 506 506
Lines 137226 137226
===========================================
Hits 110630 110630
Misses 18092 18092
Partials 8504 8504 |
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
/run-all-tests |
/run-sqllogic-test-2 |
/run-all-tests |
/run-check_dev_2 |
Signed-off-by: sre-bot <sre-bot@pingcap.com>
cherry pick to release-2.1 in PR #16286 |
cherry pick to release-3.0 in PR #16287 |
cherry pick to release-3.1 in PR #16288 |
cherry pick to release-4.0 in PR #16289 |
Signed-off-by: sre-bot <sre-bot@pingcap.com>
Signed-off-by: sre-bot <sre-bot@pingcap.com>
What problem does this PR solve?
That autoid allocator's cache step is quite big now, it will consume a lot of autoid when tidb restarts or crashes. For those scenes which treasure autoid heavily, it's not acceptable.
Parser link: #765
Problem Summary:
What is changed and how it works?
Add
auto_increment_cache
in create table / alter table statement and it will determine the allocator's cache step.But there is an exception when a statement like an insert batch(
insert into values()()...
) which requires allocating consecutive N autoid in one statement, we will make sure that the custom cache step is adequate for it withif step < N, then step = min(2N, maxstep)
Related changes
pingcap/docs
/pingcap/docs-cn
:pingcap/tidb-ansible
:Check List
Tests
Release note:
ddl: add syntax for setting the cache step of auto id explicitly.