Managing your Tuple Graveyard
summary
Runs and manages ~400 Postgres instances and explains that MVCC creates dead tuples which vacuum reclaims but never usually frees pages; recommends measuring bloat with pg_stat_tuple (accurate but CPU heavy) or fast estimation queries, and tuning autovacuum_vacuum_scale_factor (defaults 0.2, common suggestion 0.01) and vacuum_cost_delay (2ms). Advises avoiding VACUUM FULL, using pg_repack or pg_squeeze to rebuild (requires ~2x space, spikes CPU; repack can be flaky), and gives size-based dead-tuple rules of thumb (e.g., >100GB aim ≈18% dead).
AI-written summary · about
chapters (12)
- 0:00Introduction to talk
- 1:28What is MVCC in PostgreSQL
- 8:53How VACUUM works
- 12:47Understanding table bloat
- 15:37Causes of table bloat
- 18:45Quantifying table bloat
- 24:39How much bloat is too much
- 26:41Tuning Auto VACUUM
- 31:35Repacking or rebuilding tables
- 35:52Designing bloat-aware access patterns
- 41:33When to consider alternatives
- 42:14Q&A
