▲ | UUIDv7 Comes to PostgreSQL 18(thenile.dev) | |
101 points by sierikov 11 hours ago | 6 comments | ||
▲ | jph 10 hours ago | parent | next [-] | |
We evaluated UUIDv7 and determined that it's unwise to use it as a primary key. We have applications where we control the creation of the primary key, and where the primary key will be exposed to end users, such as when using a typical web app framework built with Rails, Phoenix, Loco, Laravel, etc. For these applications, UUIDv7 time is too problematic for security, so we prefer binary-stored UUIDv4 even though it's less efficient. We also have applications where we control the creation of the primary key, and where we can ensure the primary key is never shown to users. For these applications, UUIDv7 is slower at inserts and joins, so we prefer BIGSERIAL for primary key, and binary-stored UUIDv4 for showing to users such as in URLs. | ||
▲ | Recursing 10 hours ago | parent | prev | next [-] | |
Interesting comment from a previous thread on UUIDv7 in Postgres: https://news.ycombinator.com/item?id=39262286 | ||
▲ | sergeyprokhoren 4 hours ago | parent | prev | next [-] | |
95% of the comments here have nothing to do with reality. What May Surprise You About UUIDv7 https://medium.com/@sergeyprokhorenko777/what-may-surprise-y... | ||
▲ | raminf 9 hours ago | parent | prev | next [-] | |
One of the main points of using a UUID as a record identifier was to make it so people couldn't guess adjacent records by incrementing or decrementing the ID. If you add sequential ordering, won't that defeat the purpose? Seems like it would be wise to add caveats around using this form in external facing applications or APIs. | ||
▲ | gm678 9 hours ago | parent | prev | next [-] | |
Does anyone know if there are any sorts of optimizations (either internally or available to the user) for a table with a UIIDv7 PK and a `date_created` column? | ||
▲ | crest 7 hours ago | parent | prev [-] | |
"Unguessable public identifiers" press (X) to doubt This depends very much on the type of UUID e.g. a type 1 UUID is just a timestamp, a MAC address and a "collision" counter to use if your clock ticks too slowly or you want batches of UUIDs. |