VACUUM is PostgreSQL's maintenance process that reclaims storage from dead tuples (obsolete row versions left by MVCC) and updates statistics. Because Postgres's MVCC creates dead rows on every UPDATE/DELETE, VACUUM is essential to prevent bloat and keep the database healthy. Autovacuum automates it.
Why dead tuples exist (the MVCC connection)
MVCC: an UPDATE/DELETE doesn't overwrite a row — it marks the old version obsolete
(a "dead tuple") and may create a new one. Dead tuples accumulate over time.
→ Without cleanup, dead tuples cause BLOAT: wasted disk space, slower scans
(more data to read), degraded performance.
VACUUM reclaims this dead space → keeps tables compact and queries fast.
