~/talk

Unconventional ways to index UUIDs in PostgreSQL

Talkat Citus Con: An Event for Postgres 2023 · 2023-04-18..04-19· [databases]
slides:none on file

Benchmarking shows no-index point lookups at ~179 ms, while a 30 MB B-tree gives ~0.02 ms and a 32 MB hash index is slightly faster for single-row UUID lookups; BRIN using default minmax is tiny (~3.5 MB) but slow on random UUIDs (~530 ms), switching to ULID (time-sorted) makes BRIN ~12 ms, and BRIN with bloom_ops cuts random-UUID queries to ~15 ms; recommendation: B-tree for uniqueness and ranges, hash for compact fast point lookups, BRIN variants to save space when correlation exists.

AI-written summary · about

  1. 0:00Introduction
  2. 2:13What are UUIDs good for?
  3. 5:22Sortable UUIDs, specifically ULIDs
  4. 8:19Indexing UUIDs in PostgreSQL
  5. 11:08B-Tree is the king of all Postgres indexes
  6. 17:37Hash indexes, the ugly duckling of index types
  7. 21:12Using block range indexes (BRIN)
  8. 26:34BRIN Index and Bloom filters
~/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.