VACUUM はPostgreSQLのメンテナンスプロセスで、デッドタプル(MVCCによって残された時代遅れの行バージョン)からストレージを回収し、統計情報を更新します。Postgresの MVCC は UPDATE/DELETE ごとにデッドローを作成するため、VACUUM はブロートを防ぎデータベースを健全に保つために不可欠です。Autovacuum が自動化します。
デッドタプルが存在する理由(MVCC との関連)
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.
