PostgreSQL feels civilized under mixed workloads for a reason. Readers do not block writers, and writers do not block readers, even when many sessions work with the same data at once. That calm is bought by a design that keeps old versions of rows around, and the bill arrives in a specific form: rows nobody can use anymore, still taking up space, until somebody removes them. That somebody is vacuum, and understanding what vacuum does changes how an operator reads almost every size figure the platform reports.

Updates do not overwrite, and deletes do not remove

The mechanism is MVCC, multi-version concurrency control. When a row is updated, the platform does not overwrite the old row in place. It writes a new version of the row and marks the old version as superseded. Each session then sees the version that was current when its work began, so a session keeps a stable snapshot while newer work proceeds around it. Nobody has to wait for a long reader to finish before writing, and nobody reading gets a picture that shifts halfway through.

Deletions work the same way. A deleted row is marked, not removed. The version remains in the table until it is certain that no living session could still be entitled to see it. The versions left behind by updates and deletes are called dead tuples: row versions no living session can ever see again, which nonetheless occupy pages, get scanned, and inflate every measure of the table's size until they are cleaned away.

Vacuum returns space to the table, not to the disk

A vacuum pass finds dead tuples and returns their space to the table's own free-space pool, where future rows of the same table can use it. Vacuum also does related protective work, including the bookkeeping that keeps transaction identifiers safe over the platform's lifetime. Neglect that work and the consequences have a genuinely hard edge, one the platform's own evidence will warn about long before it arrives.

Notice what ordinary vacuum does not usually do. It does not shrink the file, and it does not hand the space back to the operating system. The freed space stays with the table, available for its own reuse. A busy table that was bloated will tend to refill its own freed space and stabilize, which is often exactly the right outcome: the space was going to be needed again, and now it will be used by live rows instead of ghosts.

In normal operation, nobody runs this duty by hand on a schedule. Autovacuum, a standing launcher with its workers, watches every table's churn and dispatches cleaning proportionally. The operator's job is not to be the vacuum. The operator's job is to keep the vacuum able to work, and to notice, from evidence, when it is falling behind.

Bloat is what accumulates between the marking and the cleaning

Falling behind has a name and a shape: bloat. When dead tuples accumulate faster than vacuum reclaims them, tables and their indexes occupy far more than their live data warrants. Scans read pages that are mostly ghosts. The cache fills with dead weight. A growth forecast bends upward for reasons that have nothing to do with the business growing.

Eldergrove's largest table makes the measurement habit concrete. The visit-record table occupies 80 GB. Suppose Petra's size evidence, live rows estimated against occupied pages, shows that 30 percent of it is dead space. Then the dead weight is 24 GB, and the table's live data is 56 GB. Twenty-four gigabytes is not an abstraction. It is nearly five months of the whole database's net growth at 5 GB a month, recoverable without buying anything.

That arithmetic also shows where judgment enters. Recoverable does not mean the file should be forced smaller. The expensive, locking operations that rewrite a table and actually return disk are a heavy intervention, reserved for bloat that will not be reused: a table whose workload has permanently shrunk, or whose dead fraction is so large that normal running is impaired. Reaching for the heaviest tool first is the beginner's signature.

The ladder runs in a calmer order. First, verify autovacuum is running and unobstructed. Second, tune its thresholds for the tables that churn hardest. Third, relieve whatever is holding cleanup back. Fourth, reserve rewrites for the case the evidence actually proves.

Two obstructions do most of the damage

The first obstruction is the long-lived snapshot. Vacuum cannot reclaim a dead tuple while any open transaction might still be entitled to see it. One forgotten session, or one reporting transaction left open over a weekend, and vacuum runs, reports success, and reclaims almost nothing, while bloat climbs and the operator insists the cleaning is on. The cleaning is running. It is simply not allowed to clean.

The second obstruction is scale. When thresholds are set as a percentage of a very large table, enormous quantities of dead tuples can accumulate before cleaning even starts. The arithmetic that serves a small table reasonably serves the largest tables last, and the largest tables are precisely the ones where dead space costs the most. Check those figures weekly for the ten largest tables.

The misconception to retire

The familiar version runs like this: we deleted a million old rows, so the disk should drop by that much, and anyway a scheduled job can vacuum once a month, like defragmenting. Both halves are wrong in the same way. Deletion under MVCC marks rows dead; it removes nothing from the file. And vacuum is not a monthly chore. It runs far more often than monthly, proportional to churn, returning space to the table for reuse rather than to the disk. Bloat is what accumulates between the marking and the cleaning.

Experience it, don’t just read about it

Vacuum is the second half of the MVCC design, returning dead space to the table for reuse rather than to the disk is Concept 6 of PostgreSQL in Depth (Course No. 570), from Cognosco Learning, a learning company powered by AI. The course builds the platform discipline beyond this distinction — Storage and Growth — Pages, Free Space, and the Size of Tomorrow, Indexes as Platform Cost — Every Index Is Rent, and Statistics and the Planner's Picture — Keeping the Map Current — each worked through with an Agentic Socratic AI coach, one learner at a time. Try a Free Preview at cognoscolearning.com.

Try a Free PreviewAll Signature CoursesThe Corporate License

Navigate your own course.

← All Insights

© 2026 Cognosco Learning. All rights reserved.