~/talk

Fun with UUIDs

Talkat PGDay Lowlands 2025 · on Friday, 2025-09-12· [databases]
slides:none on file

UUIDs store 16 bytes so the talk demonstrates encoding tenant, time and object bits into them, shows a simple Postgres SQL implementation plus a C extension, and measures real effects: UUID indexes are about double the index size, a sequential bigint index hits ~27,000 shared buffers while random UUID index hits 9.5 million buffer hits, and a Java benchmark of 10 million inserts shows UUID schemes perform similarly to random 64‑bit integers (sequential still fastest). Using UUID v7 time prefix or custom time‑first layouts restores locality, partitioning by time works, tenant list partitioning is limited by constraint exclusion, and the C extension is only ~25% faster than the SQL approach.

AI-written summary · about

  1. 0:00Introduction and welcome
  2. 1:47Speaker introduction
  3. 2:51What is a UUID
  4. 5:21UUIDs in PostgreSQL
  5. 6:04Problems with random UUIDs
  6. 8:12Benchmarking UUID performance
  7. 12:32Advantages of using UUIDs
  8. 15:44Encoding data into UUIDs
  9. 18:33UUID v7 and flexible UUIDs
  10. 23:59Generating custom UUIDs in SQL
  11. 26:50Decoding and extracting UUID data
  12. 28:55Partitioning and tenant sharding
  13. 31:02C extension for UUID operations
  14. 32:54Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.