-
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
*: support auto_increment_increment & auto_increment_offset. #14301
Conversation
/run-unit-test |
/bench |
Benchmark Report
@@ Benchmark Diff @@
================================================================================
--- tidb: 5d76de903a6d2c95f83da365e5d757dad9fb9e7b
+++ tidb: 6dba49685cc9595d930c78a202b90b657bcd3cc1
tikv: 267a5ebf7edb229cc53f5a8faa71975225bc6d8e
pd: ea974c9488b8d304a72916d8cc50962f5ab99c5d
================================================================================
oltp_update_index:
* QPS: 6369.24 ± 0.65% (std=29.06) delta: -0.21% (p=0.743)
* Latency p50: 20.03 ± 0.35% (std=0.07) delta: -0.10%
* Latency p99: 37.23 ± 0.90% (std=0.34) delta: -0.92%
oltp_insert:
* QPS: 4702.86 ± 0.32% (std=11.54) delta: 0.16% (p=0.395)
* Latency p50: 27.21 ± 0.33% (std=0.07) delta: -0.17%
* Latency p99: 45.42 ± 6.42% (std=1.89) delta: -3.46%
oltp_read_write:
* QPS: 15845.50 ± 0.26% (std=29.71) delta: 0.21% (p=0.875)
* Latency p50: 162.33 ± 0.84% (std=0.84) delta: 0.08%
* Latency p99: 322.04 ± 8.78% (std=16.97) delta: 1.48%
oltp_point_select:
* QPS: 43423.43 ± 0.93% (std=247.68) delta: 1.61% (p=0.012)
* Latency p50: 2.95 ± 0.23% (std=0.00) delta: -1.39%
* Latency p99: 9.60 ± 2.21% (std=0.14) delta: 0.44%
oltp_update_non_index:
* QPS: 4746.72 ± 0.23% (std=6.78) delta: 0.23% (p=0.163)
* Latency p50: 26.96 ± 0.23% (std=0.04) delta: -0.24%
* Latency p99: 40.86 ± 1.19% (std=0.34) delta: -1.09%
|
/build |
/run-unit-test |
1 similar comment
/run-unit-test |
if e.handleErr(col, &autoDatum, cnt, err) != nil { | ||
return nil, err | ||
} | ||
// It's compatible with mysql setting the first allocated autoID to lastInsertID. | ||
// Cause autoID may be specified by user, judge only the first row is not suitable. | ||
if e.lastInsertID == 0 { | ||
e.lastInsertID = uint64(min) + 1 | ||
e.lastInsertID = uint64(min) |
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.
Why the previous code is uint64(min) + 1
but now it can be uint64(min)
?
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.
we already derive the firstID and increment from the allocated range.
AllocBatchAutoIncrementValue
now return firstID and increment.
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
LGTM |
/run-all-tests |
cherry pick to release-3.0 failed |
What problem does this PR solve?
Fix #14245
Support auto_increment_increment & auto_increment_offset.
What is changed and how it works?
Check List
Tests
Code changes
func CalcNeededIDs(base, n, increment, offset int64, isUnsigned bool) int64
Alloc(tableID int64, n uint64, increment, offset int64) (int64, int64, error)
Related changes
Release note
auto_increment_increment
&auto_increment_offset
.