IT lexicon › Database › UUIDv7

UUIDv7

Database På svenska → Updated: 2026-07-29

A UUID variant that begins with a millisecond timestamp and fills the rest with randomness. Standardized in RFC 9562 (2024). The result is globally unique identifiers that nonetheless sort in creation order.

The problem it solves is concrete. UUIDv4 is entirely random, meaning each new row lands at an arbitrary point in the primary key's B-tree. Inserts scatter across the whole index, pages split, cache hit rates drop and the index grows faster than necessary — noticeable already at a few million rows. With v7 new rows land next to each other at the right edge of the tree, just like a sequence number, while identifiers can still be generated client-side with no coordination. The price is that creation time is readable from the key, which is sometimes unwanted. Predecessors with the same idea: ULID and Snowflake IDs.

← Back to the lexicon