auto-increment: change "continuous" to monotonic#3584
Conversation
|
@kolbe, PTAL. |
|
@nullnotnil I suggest updating v3.1, v3.0, v2.1 in another PR. That would be easier. |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
|
cherry pick to release-4.0 in PR #3647 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com> Co-authored-by: Null not nil <67764674+nullnotnil@users.noreply.github.com>
|
It looks like the auto-increment docs are not present in 3.1 and below. They are still relevant, but if nobody has requested docs for it yet - I will leave it at this PR + the 4.0 cherry pick. |
@nullnotnil I think that's ok. |
|
@nullnotnil Hi, I think the concept "monotonic" has been explained in the increment part. This section does illustrate the "continuous" feature: create table t (a int primary key AUTO_INCREMENT);
insert into t values (), (), (), ();
select * from t;
+---+
| a |
+---+
| 1 |
| 2 |
| 3 |
| 4 |
+---+ |
Thanks! I will attempt another PR to merge the two. It is better not to call it "continuous" still, because a user might rely on that behavior incorrectly. |
What is changed, added or deleted? (Required)
The AUTO_INCREMENT doc used the word "continuous" when it should be "monotonic". Continuous means "without any abrupt changes", i.e. at a constant rate (which could be up or down). Auto_increment is not really constant - since restarts could make values jump quite a bit. So could requesting a new batch of cached values.
Monotonic means "either never decreases or never increases". Which is the property it guarantees on a per-server basis.
The language will need version-specific changes because it says "30 thousand by default", but it needs to be 30 thousand explicitly for 2.1 which does not support
AUTO_ID_CACHE.Which TiDB version(s) do your changes apply to? (Required)
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?