Understanding PostgreSQL VACUUM at the Page Level: Dead Tuple Lifecycle and Space Reclamation
By
Radim Marek
Summary
This article provides an in-depth technical exploration of VACUUM operations at the page level in PostgreSQL databases. It explains how VACUUM handles dead tuple cleanup beyond what HOT (Heap-Only Tuple) pruning can achieve, covering cold updates, DELETEs, index entry cleanup, free space map registration, and visibility map maintenance. The article uses tools like pageinspect, pg_freespace, and pg_visibility to demonstrate the lifecycle of a dead tuple — from losing its storage, to index entry removal, to slot reclamation, and eventual space reuse.
Source
Key quotes
· 3 pulledFor everything else (cold updates that touch indexed columns, plain DELETEs, index entry cleanup, free space map registration, visibility map maintenance) we need VACUUM.
Pruning is exactly that: a shortcut. It only works within a single page, and only for HOT-updated tuples.
Watch a VACUUM cycle with pageinspect, pg_freespace, and pg_visibility: how a dead tuple loses its storage, then its index entry, then its slot, and how the freed space gets reused.
You might also wanna read
How PostgreSQL survived near-death to become a cornerstone of modern cloud infrastructure
This feature article chronicles the unlikely survival and rise of PostgreSQL, tracing its origins from Michael Stonebraker's Postgres projec
PostgreSQL positioned as a solution to AI-driven datacenter energy demands
This article discusses how AI workloads and datacenter expansion are driving an energy crisis, and positions Postgres (PostgreSQL) as a solu
PostgreSQL Connection Pooling Explained: How It Works and Why It Matters
PostgreSQL Connection Pooling Explained: How It Works and Why It Matters
Postgres evolves from storage system to data movement hub as AI and interoperability reshape its future
Postgres, traditionally viewed as a transactional database for operational workloads like customer records and financial transactions, is un
thenewstack.io·11d agoMicrosoft's Extended RUM Index in DocumentDB for PostgreSQL Improves ESR Query Performance
Microsoft has fixed a limitation in the DocumentDB extension for PostgreSQL by introducing an Extended RUM index that preserves key ordering
dev.to·29d agoRethinking database architecture: From monolithic storage to Lakebase and LTAP
The article discusses the evolution of database architecture, starting from the author's PhD experience at UC Berkeley where OLTP databases
Rethinking database architecture: From monolithic storage to Lakebase and LTAP
The article discusses the evolution of database architecture, starting from the author's PhD experience at UC Berkeley where OLTP databases

Comments
Sign in to join the conversation.
No comments yet. Be the first.