Internals
Autovacuum
Background process that automatically runs VACUUM and ANALYZE on tables that accumulate dead tuples or stale statistics.
Autovacuum is a background launcher that periodically inspects every database and dispatches worker processes to run VACUUM and ANALYZE against tables that need them. The thresholds depend on the dead-tuple count relative to live rows (default: more than 20% of the table is dead) and the number of inserts since the last ANALYZE.
Autovacuum is essential, not optional. Disable it and tables accumulate bloat, the visibility map falls out of date, and Index Only Scans stop working. Tune it per-table when defaults are too lazy for hot tables — ALTER TABLE ... SET (autovacuum_vacuum_scale_factor = 0.05) is a common starting move for high-write tables.
To check autovacuum activity, query pg_stat_user_tables: last_autovacuum, n_dead_tup, and n_mod_since_analyze reveal whether autovacuum is keeping up.