Parameter · Reporting and Logging / What to Log
log_autovacuum_min_duration
Sets the minimum execution time above which autovacuum actions will be logged. -1 disables logging autovacuum actions. 0 means log all autovacuum actions.
- Default:
10min - Type: integer (ms)
- Range: -1 … max (2147483647)
- Applies: Reload
In plain words
Writes a detailed report to the log for every automatic vacuum or analyze that runs at least this long. The default (10 minutes) records only the long ones; 0 records every run, a great way to see what autovacuum is doing.
For DBAs and operators
Default changed from -1 to 10min in PostgreSQL 15. Can be set per table: ALTER TABLE orders SET (log_autovacuum_min_duration = 0). When it is not -1, it also logs when an autovacuum action is skipped because of a conflicting lock or a concurrently dropped table. A real report (18.6, with 0):
What to look for: "dead but not yet removable" (an old snapshot, replication slot or prepared transaction holds back cleanup; compare removable cutoff … XIDs old), index scans > 1 (maintenance_work_mem too small), low read/write rates (cost-based delay throttling), and "aggressive" in the header (anti-wraparound). "eagerly scanned" is new in 18 (eager freezing of all-visible pages).
How to change it
Change in postgresql.conf or ALTER SYSTEM, then run SELECT pg_reload_conf().
See it in context
Autovacuum: when tables get vacuumed VACUUM Autovacuum launcher and workers
Related parameters
autovacuum autovacuum_naptime log_min_duration_statement maintenance_work_mem autovacuum_vacuum_cost_delay