Pseudo Perfect Hashing of INT64 -> INT64 to distribute autoincrement values

23 views
Skip to first unread message

ddorian43

unread,
May 3, 2018, 7:10:52 AM5/3/18
to TiDB user group
Hi,

I'm not really sure how possible it would be, but a kinda perfect hash function I think should exist that translated autoincrement values to pseudo random so they get distributed into different ranges when primary key is `(id autoincrement)` ? I mostly care the `id` to be small (64bit integer) + unique + random distributed.

Another way would be to prefix the primary-key with (hash(id), id) but this will make primary keys larger.

Any ideas ?

Regards,
ddorian43

Ewan Chou

unread,
May 3, 2018, 2:15:34 PM5/3/18
to TiDB user group
Hi, 
We support a `shard_rowid_bits` syntax that shards an implicit row id.

It's possible to make the explicit auto-id sharded, but we don't support it yet.
Reply all
Reply to author
Forward
0 new messages