4 ms·
As a quick reference for readers: The UUID specs use the terms "variant" and "version" a little funny; "variant" is essentially the revision (so all modern UUI
by LukeShu 5y ago
As a quick reference for readers:
The UUID specs use the terms "variant" and "version" a little funny; "variant" is essentially the revision (so all modern UUIDs have variant=0b10 to specify RFC 4122 UUIDs), and "version" is a 4-bit number identifying the sub-type within that variant:
UUIDv1 time-based
UUIDv2 legacy DCE security thing, not wideley used
UUIDv3 name-based with md5 hashing
UUIDv4 randomness-based
UUIDv5 name-based with sha1 hashing
This draft registers a few new sub-types:
UUIDv6 sortable time-based, Gregorian calendar
UUIDv7 sortable time-based, Unix time
UUIDv8 sortable time-based, custom time
- deleted 5y ago[deleted]
- paulddraper 5y agotl;dr Use UUIDv4 and get on with your day.
- ygra 5y agoWell, not if you need database primary keys with sensible index locality. Which is what this draft is about.
- phkahler 5y agoAren't indexes sorted? I suppose using time as the MSBs means new batches are always appended (after sorting just the new ones).
- mianos 5y agoYes they are. But, consider the common query, for records based on an time index on the last day. This index will point to a bunch of primary keys and those, being random, will be spread across a much wider range of blocks. If the primary key was just the time, those items would be on the same or close blocks.