Skip to content
masterclass Buddy

PostgreSQL · Concept

Autovacuum

PostgreSQL uses VACUUM to maintain tables: it reuses space, refreshes planner statistics, updates visibility data, and freezes old rows. Autovacuum performs this work automatically when table activity reaches configured thresholds.

Last updated

Syntax

VACUUM [ ( option [, ...] ) ] [ table_and_columns [, ...] ]
ANALYZE [ ( option [, ...] ) ] [ table_and_columns [, ...] ]

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • VACUUM FULL
  • ANALYZE
  • autovacuum
  • autovacuum_max_workers
  • autovacuum_naptime
  • autovacuum_vacuum_threshold
  • autovacuum_vacuum_scale_factor
  • autovacuum_analyze_threshold

Source: PostgreSQL: Documentation: 18: 24.1. Routine Vacuuming. Checked 2026-11-03.