PostgreSQL 18 v7 UUIDs 0 ▲ Andrew Atkinson 10 days ago · Tech · hide · 0 comments We recently upgraded all databases to Postgres 18.4 and with that we gained the uuidv7() function that can generate v7 UUID values. Since the system generally uses v1 and v4 UUIDs which mostly come from uuid data type primary key columns and their generation function, we had plans to adopt v7 values for newly inserted rows by changing the column default. How did it go? Current UUID generation The system uses UUIDs throughout. I have typically advocated for bigint and sequences over UUID values for primary keys, but I have softened my position on this as I worked on lots of client databases. My main beef was the poor performance due to random IO from v4 UUIDs. The poor performance stemmed from reduced page density, more frequent page splits, and increased latency when inserting index entries. Fortunately this system mostly uses v1 which are less efficient than v7 but do have a portion of bits corresponding to time and thus don’t have as bad of latency as v4. With that said, the system… No comments yet. Log in to reply on the Fediverse. Comments will appear here.