Dev Tools · 2h ago
PostgreSQL 18 Adds Native UUIDv7 for Faster Primary Keys
PostgreSQL 18 introduces a native uuidv7() function that generates time-ordered UUIDs, avoiding the performance penalties of random UUIDv4. In a 50-million-row benchmark, bulk inserts with v7 completed in 1.8 minutes versus 20 minutes with v4, and the index was 25% smaller. Range scans on the primary key ran about 3x faster with v7.
Meridian48 take
This is a practical performance improvement for large-scale PostgreSQL deployments, but the real win is for teams that need UUID properties without sacrificing insert throughput.
Read the full reporting
Stop Using Random UUIDs as Primary Keys: uuidv7() Lands in PostgreSQL 18 →
DEV Community
postgresqluuidv7