Benchmark: UUIDv7 in PostgreSQL 18 matches bigint insert speed
Loading 10 million rows into PostgreSQL 18.6 keyed by UUIDv7 took 37.3 s, the same as bigint, while UUIDv4 took 84.2 s and wrote 2.2x more WAL. The UUIDv7 primary key index was 301 MB versus 385 MB for UUIDv4, though 41% larger than bigint's.
- 10M-row load: 37.3 s for UUIDv7 and bigint, 84.2 s for UUIDv4
- WAL written by the load: 2.1 GB for UUIDv7 vs 4.6 GB for UUIDv4
- PK index size: 301 MB for UUIDv7, 385 MB for UUIDv4, 214 MB for bigint
- Single-row inserts with 8 clients: 48,690/s for UUIDv7 vs 41,331/s for UUIDv4
Read next
AI