/explain/dead-tuple

dead tuple

A dead tuple is a row version whose xmax is committed and older than every live snapshot: nobody can see it anymore, but it still occupies its bytes on the page and its entries in every index. Vacuum exists to find these and free the space for reuse. n_dead_tup in pg_stat_user_tables is the running estimate, and the trigger formula compares exactly this number against the threshold.

DEMO — toy table, 4 rowsnext xid 4711
ctidxminxmaxpayloadvisibility
(0,1)4702—'checkout'visible
(0,2)4703—'signup'visible
(0,3)4707—'refund'visible
(0,4)4710—'login'visible
LIVE / DEAD TUPLES
4 / 0
HEAP VERSIONS ON DISK
4
OPEN SNAPSHOT
none

UPDATE writes a new version and stamps the old row’s xmax. Open a snapshot first to see vacuum blocked.

SEE ALSO
xminbloatautovacuum_vacuum_scale_factor← back to start
The estimate comes from the statistics collector, not a count: it drifts between analyzes and resets on crash. Treat it as a signal, not an inventory.
dead tuple — robovac