DBConf 2026 gathered database engineers from PostgreSQL, MySQL, MongoDB, and SQL Server communities for two days of talks on indexing strategies, UUID adoption, and query optimization. UUID v7’s arrival in PostgreSQL 18 triggered comparisons across all major database platforms. See UUID in Databases for the storage and indexing details.
Session: PostgreSQL 18 UUID v7 — benchmark results
A PostgreSQL core contributor presented insert benchmarks comparing UUID v4 and UUID v7 primary keys on PostgreSQL 18:
| Table size | UUID v4 inserts/sec | UUID v7 inserts/sec | Improvement |
|---|---|---|---|
| 1M rows | 82,000 | 94,000 | +15% |
| 10M rows | 61,000 | 88,000 | +44% |
| 100M rows | 29,000 | 84,000 | +190% |
The improvement grows with table size because UUID v4’s random inserts cause more B-tree page splits as the index grows. UUID v7’s monotonic timestamp prefix always inserts at the right edge — the same access pattern as SERIAL. See UUID v7 Performance Benchmarks.
-- PostgreSQL 18 — server-side UUID v7 generation
CREATE TABLE orders (
id uuid PRIMARY KEY DEFAULT uuidv7(),
customer_id uuid NOT NULL,
status varchar(32) NOT NULL,
created_at timestamptz NOT NULL DEFAULT now()
);
-- Time-range query using primary key — no secondary index needed
SELECT * FROM orders
WHERE id >= uuidv7_boundary('2026-10-01T00:00:00Z')
ORDER BY id;
See PostgreSQL 18 Native UUID v7 for the full function reference.
Session: MySQL UUID v7 storage patterns
MySQL 9 does not have a native uuidv7() function. The session covered two patterns:
-- Pattern 1: BINARY(16) with swap_flag for sort order
-- UUID_TO_BIN(uuid, 1) moves time_high to front — sort-preserving
CREATE TABLE orders (
id BINARY(16) PRIMARY KEY DEFAULT (UUID_TO_BIN(UUID(), 1)),
customer_id BINARY(16) NOT NULL,
status VARCHAR(32) NOT NULL
);
-- Query: convert back for display
SELECT BIN_TO_UUID(id, 1) AS id, status FROM orders;
-- Pattern 2: application-generated UUID v7, stored as BINARY(16)
-- Use uuid npm package or Python uuid.uuid7() in app layer
See MySQL UUID Storage Best Practices.
Session: MongoDB UUID v7 document IDs
The MongoDB session highlighted BSON Binary subtype 4 for UUID storage:
import { Binary } from 'mongodb';
import { v7 as uuidv7, parse as uuidParse } from 'uuid';
const id = new Binary(Buffer.from(uuidParse(uuidv7())), Binary.SUBTYPE_UUID);
// 16 bytes — vs 36 bytes for string storage
See UUID in the MongoDB Driver.
Session: Zero-downtime migration
The final keynote session walked through a live zero-downtime migration from UUID v4 to UUID v7 on a 50M-row PostgreSQL table using the dual-column approach. Key timing on a production-like instance:
- Add
id_v7 uuidcolumn: instant (no default, no lock) - Backfill 50M rows at 5,000/batch: ~25 minutes
CREATE INDEX CONCURRENTLY: ~8 minutes- PK swap transaction: < 200ms
See Zero-Downtime UUID Migration for the full step-by-step guide.
Further reading
- UUID in Databases — storage and indexing
- UUID v7 Performance Benchmarks
- PostgreSQL 18 Native UUID v7
- MySQL UUID Storage Best Practices
- UUID in SQL Server
- Zero-Downtime UUID Migration
External references
Frequently asked questions
How do PostgreSQL and MySQL differ in UUID v7 storage performance?
PostgreSQL 18 stores UUID as a native 16-byte type with byte-order comparison — UUID v7 inserts at the B-tree's right edge, matching integer auto-increment performance. MySQL 9 uses CHAR(36) by default (case-insensitive collation breaks sort order for UUID v7) or BINARY(16) with UUID_TO_BIN(uuid, 1) for time-order-preserving storage. The swap_flag=1 parameter in UUID_TO_BIN moves the time-high bits to the front, restoring sort order in MySQL. See UUID in Databases.
Does SQL Server's uniqueidentifier type support UUID v7 sort order?
No — SQL Server stores uniqueidentifier in a non-standard byte order (the first three byte groups are little-endian). UUID v7 values do not sort chronologically as uniqueidentifier without byte-swapping. For sort-preserving UUID v7 in SQL Server, store as BINARY(16) or use NEWSEQUENTIALID() as a partial alternative. See UUID in SQL Server.