In this docs, https://docs.pingcap.com/tidb/stable/dev-guide-unique-serial-number-generation It says "Finally, note that the IDs generated by the above two solutions are not random enough to be directly used as primary keys for TiDB tables. In practice, you can perform bit-reverse on the generated IDs to get more random new IDs." However, does anyone know what this bit-reverse refers to? What specific modifications shall I do to make snowflake style ID more random?
In TiDB, how to use snowflake style uuid without causing hot spot by doing bit reverse?
74 views Asked by Tetsuya3850 At
1
In general, UUID generators ensure uniqueness, but most UUID algorithms produce IDs that are somewhat ordered. This orderliness can lead to hotspots in TiDB, and the purpose of bit-reverse is to transform ordered IDs into more random ones.
for example: