*: support specifying range bits for auto_random#36860
Conversation
|
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. DetailsReviewer can indicate their review by submitting an approval review. |
e6181f1 to
ecb4318
Compare
|
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/bf44ec094c930a6d0d1c026e81898751064b98a7 |
|
@tangenta Please resolve the conflicts. |
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 5fa589a |
TiDB MergeCI notify✅ Well Done! New fixed [1] after this pr merged.
|
What problem does this PR solve?
Issue Number: close #32508
Problem Summary: Previously,
auto_randomcolumn makes use of the highest several bits for shard. Anauto_randomID can be too large to be represented in some special data types. For example, JSON's number can only represent 54-bits integer.What is changed and how it works?
This PR introduces a new syntax, which allows users to specify the max "range bits" for the
BIGINTtype:In the above SQLs,
54and32are the "range bits". The new 64-bit shard ID format is as follows:range bitsis equal tosign bit + shard bits + incremental bits.reserved bitsis equal to64 - range bits. The content of the reserved bits are always zero.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.