/explain/aggressive-vacuum

aggressive vacuum

An aggressive vacuum is a normal vacuum that refuses shortcuts: it visits every page not marked all-frozen (including all of the all-visible pages a normal pass skips) freezes what qualifies, and advances relfrozenxid. It gets triggered by table age, not dead rows: politely at vacuum_freeze_table_age, forcibly at autovacuum_freeze_max_age. The forced form runs even with autovacuum off and does not yield to lock waiters, which is how a scheduled DDL statement ends up queueing a whole application behind it.

DEMO — xid age over 365 d, toy tablesame chart system as the report
2,147,483,647 (wraparound)freeze_max_age = 200,000,000
day 090180270365
autovacuum_freeze_max_age200,000,000
default 200,000,000 · max 2,000,000,000
xid consumption40.00 M/day
transactions per day, 1 M → 400 M
AGGRESSIVE VACUUM EVERY
5.0 d
RUNS PER YEAR
73.0
MARGIN TO SHUTDOWN
48.7 d
SEE ALSO
vacuum_freeze_table_ageautovacuum_freeze_max_agewraparound← back to start
Give every scheduled DDL a lock_timeout: the Joyent (2015) and Duffel (2021) outages are the same incident six years apart: DDL queued behind an anti-wraparound vacuum, everything queued behind the DDL.
aggressive vacuum — robovac