
UUIDv7 or UUIDv4 keys in Postgres: 11M rows, 22x slower
Use UUIDv7 instead of UUIDv4 as a primary key in PostgreSQL 18 if the table will grow past a few million rows. In our test on a laptop, 11 million inserts with genrandomuuid() took 1,526 seconds. The
Wed Oct 21 2026 · 10 min read · 0 views