Kingsfordweg 151, 1043GR Amsterdam, The Netherlands ● 24/7 support — support@novogara.com
Knowledge base

Vacuum and bloat

A PostgreSQL table can grow even as you delete from it. Understanding why turns a mysterious disk-space problem into routine maintenance.

Where the dead rows come from

PostgreSQL does not overwrite a row on update or delete; it marks the old version dead and writes a new one. Those dead versions sit in the table until cleaned up, so a busy table can hold far more than its live row count suggests.

What autovacuum does

Autovacuum reclaims the dead space so it can be reused and keeps the statistics the planner relies on fresh. On a write-heavy table the defaults can fall behind; tuning it to run more often prevents the bloat building faster than it is cleared.

When you need more than vacuum

Ordinary vacuum reuses space but does not shrink the file. If a table has already bloated badly, a repack or rebuild returns the space to the disk — plan it in a quiet window, and see database tuning and reclaiming disk space.


Still stuck? Mail support@novogara.com — an engineer answers, at any hour. Back to the knowledge base