VACUUM ist Postgre SQLs Wartungsprozess, der Speicher von dead tuples (veraltete Zeilenversionen, die von MVCC hinterlassen werden) zurückgewinnt und Statistiken aktualisiert. Da Postgres' MVCC bei jedem UPDATE/DELETE dead rows erzeugt, ist VACUUM essentiell, um Bloat zu verhindern und die Datenbank gesund zu halten. Autovacuum automatisiert dies.
Warum es wichtig ist
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.
