Fun With UUIDs
summary
Explains that random UUIDs (v4) cause index churn via Postgres free space map and index-only scans, shows a buffer-count blowup versus sequential keys, and demonstrates fixes: time-ordered UUIDs (UUIDv7 or custom Version 8 schemes called FLUUID) with high-order timestamp bits (48 or 32 bits) restore locality. Benchmarks insert 10 million rows of 500-byte payloads, find about 10% slower multi-tenant UUID inserts vs bigint, and outlines SQL functions, partitioning by ID, and a bitwise-UUID extension.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 1:14What Are UUIDs – Definition & Structure
- 3:43Problems with UUIDs
- 9:02Why Use UUIDs
- 11:54Encoding Additional Information in UUIDs
- 14:14Best of Both Worlds with UUIDv7
- 22:32Partitioning with UUIDs
related talks
38mFun with UUIDs
29mWhy UUIDs are Secretly Incredibly Fascinating
34mUnconventional ways to index UUIDs in PostgreSQL
57mUnderstanding Advanced Datatypes in PostgreSQL
45mHibernate: Mapping Strategies and Their Database Performance Impact
43mTuning PostgreSQL for High Write Workloads
52mBoosting Typical Query Patterns: PostgreSQL 18's Performance Enhancements
57mUnderstanding Advanced Datatypes in PostgreSQL
