Explain, Measured

PostgreSQL performance, measured. Every number comes from a run you can repeat.

  1. UUIDv4 or UUIDv7 for a primary key? 5 million rows on PostgreSQL 18

    UUIDv7 inserted 5 million rows in 27 seconds, UUIDv4 in 46. The v4 index was 29% bigger. Random lookups cost the same.