DB Internals AtlasPostgreSQL 18.6 Home About

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):

LOG: automatic vacuum of table "postgres.public.t": index scans: 0 pages: 0 removed, 1667 remain, 1667 scanned (100.00% of total), 0 eagerly scanned tuples: 0 removed, 200000 remain, 0 are dead but not yet removable removable cutoff: 762, which was 0 XIDs old when operation ended new relfrozenxid: 753, which is 1 XIDs ahead of previous value frozen: 0 pages from table (0.00% of total) had 0 tuples frozen visibility map: 1666 pages set all-visible, 0 pages set all-frozen (0 were all-visible) index scan bypassed: 1 pages from table (0.06% of total) have 1 dead item identifiers avg read rate: 0.000 MB/s, avg write rate: 0.580 MB/s buffer usage: 3384 hits, 0 reads, 4 dirtied WAL usage: 1670 records, 4 full page images, 131472 bytes, 0 buffers full system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.05 s

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

All Reporting and Logging parameters