~/talk

LISTEN Carefully: How NOTIFY Can Trip Up Your Database

Talkat POSETTE: An Event for Postgres 2026 · 2026-06-16..06-18· [databases]
slides:none on file

A trigger that runs NOTIFY on every commit obtains a cluster-wide access-exclusive lock on pg_database to serialize delivery, causing surprising lock timeouts and accidental serialization under load. The team replaces immediate pg_notify with an unlogged notification_queue table, uses pg_try_advisory_xact_lock to let one sender batch and emit notifications, logs queue length in ~0.5% of transactions (modulo 199), and tests at 4x production traffic — result: lock timeouts disappear and throughput more than triples.

AI-written summary · about

  1. 0:00Music & introduction
  2. 0:53Speaker background and context
  3. 1:35What LISTEN/NOTIFY actually does
  4. 3:30How publisher-subscriber flow works
  5. 6:36Production architecture with triggers and Redis
  6. 8:07Symptoms: lock timeouts and query slowdowns
  7. 10:02Root cause: global lock and accidental serialization
  8. 13:17Initial fixes and why they failed
  9. 14:43Queue-based async notification redesign
  10. 18:12Advisory locks and batched notifications
  11. 22:11Testing at scale and observed improvements
  12. 24:39Key lessons and practical takeaways
~/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.