3 ms·
There was a story posted recently about how the properties of UUIDs are not a good match for how databases index columns. It proposed the 'ulid' which helps in
by yrro 7y ago
There was a story posted recently about how the properties of UUIDs are not a good match for how databases index columns. It proposed the 'ulid' which helps in that regard.
- geezerjay 7y agoThank you for mentioning ulid. Very interesting,and perhaps also useful.
- mywittyname 7y agoI'm curious about this if you remember the reference. My gut reaction is UUID is better because the keys would be more uniformly distributed across the key-space. With sequential IDs, a binary tree would end up always being unbalanced -- though, this effect would be reduced as the database gets larger.
- int_19h 7y agoI recall seeing UUID generators that are specifically tuned for use as keys in databases that specifically support them as primary keys. E.g. this has been around for a while: https://docs.microsoft.com/en-us/sql/t-sql/functions/newsequentialid-transact-sql https://docs.microsoft.com/en-us/sql/t-sql/functions/newsequ...
- dvlsg 7y agoI've used this to good effect before. Note that the endianness may catch you by surprise, though. For example, what's good in postgres may not be good for SQL server.