UUID Generator Best Practices 2026: v1 vs v4 vs v7 — Why UUID v7 Solves 92% of Your MySQL/PostgreSQL INSERT Performance Problems (Benchmark 1M Rows)
A side-by-side benchmark of UUID v1 (MAC + time), v4 (pure random, most common), v6 (time-ordered rearranged v1), v7 (unix-time-ms + random, RFC 9562 July 2024 standard — replaces v1/v6), v8 (custom application-specific). Insertion benchmarks on MySQL 8 InnoDB with 1M rows using BIGINT autoinc / BINARY(16) UUID v4 / BINARY(16) UUID v7: v4 causes 4.3× more page splits, 2.8× larger index size after 1M inserts, 68% QPS drop under 256-concurrent writes. v7 is within 4% of BIGINT auto-inc performance on index size, insert latency, and buffer pool hit ratio. Includes 4 anti-patterns: never use string CHAR(36) for UUID columns (2.3× storage, slow ASCII compare), never expose v1 MAC in public URLs (leaks NIC vendor + hostname via Wireshark lookup), never use v4 as distributed k-ordered ID, and the 0.0000002% UUID collision math for 103 trillion v4 IDs.