Lesson 27 · Senior PostgreSQL backend engineering
Bloat, HOT updates, and autovacuum
The write-heavy side of PostgreSQL: dead tuples, cleanup pressure, and why “it still works” can still be expensive.
Your win: explain how write-heavy tables accumulate cleanup debt, why bloat happens, and how HOT updates and autovacuum affect real backend cost.
UPDATE can leave an old row version behind. If cleanup cannot keep up, the table gets heavier even when the logical number of rows barely changes.
The problem: yesterday’s writes become today’s tax
Write-heavy services often pay for yesterday’s updates today: larger tables, worse cache behavior, more vacuum work, and slower scans. That is why storage behaviour is not just an internals curiosity. It turns into visible backend cost.
Three ideas to keep straight
- Bloat — too much dead or wasted space relative to live data
- HOT update — an update that can avoid touching indexes under the right conditions
- Autovacuum — the background system that reclaims dead tuples and refreshes planner stats
The senior explanation is not just “vacuum cleans things.” It is “this write pattern creates this kind of cleanup pressure, and here is why the table keeps getting more expensive to read or maintain.”
Routine vacuuming docs
The official docs are the best source for how VACUUM and ANALYZE keep MVCC practical at scale.
Check yourself (from memory)
Q1. Bloat usually comes from…
Sources. Routine Vacuuming.