-
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) #16289
ddl: add syntax for setting the cache step of auto id explicitly. (#15409) #16289
Conversation
/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
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
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
Your auto merge job has been accepted, waiting for 16181 |
cherry-pick #15409 to release-4.0
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.