🚨 UUIDv4 or UUIDv7 for your Postgres primary key?
We inserted 2 billion UUIDs to settle it.
100M rows. Postgres 18. 1 GiB shared_buffers.
⚡ int8: 23.5k inserts/s
⚡ UUIDv7: 21.7k inserts/s
🐌 UUIDv4: 13.9k inserts/s
UUIDv4 starts slowing at ~26M rows. Why? 👇
A weekly podcast about all things PostgreSQL — by @michristofides and @samokhvalov. Also at fosstodon.org/@postgresfm

