/explain/autovacuum_vacuum_scale_factor

autovacuum_vacuum_scale_factor

The trigger for a vacuum is autovacuum_vacuum_threshold + autovacuum_vacuum_scale_factor × n_live_tup, and the default factor is 0.2: twenty percent of the table has to die before autovacuum looks at it. On a billion-row table that is 200M dead rows and often weeks between runs. Large tables converge on the opposite recipe: factor 0, and a fixed threshold sized to about an hour of the measured dead-row rate, so vacuum runs on a clock instead of on table size.

DEMO — dead tuples over 60 d, toy table50M rows · 2M dead/day
trigger = 10.00 M dead tuples
day 015304560
autovacuum_vacuum_scale_factor0.20
default 0.2 · 0 decouples the trigger from table size
autovacuum_vacuum_threshold50
default 50 · the fixed floor
VACUUM EVERY
5.0 d
PEAK DEAD ROWS
10.00 M
PEAK BLOAT
20.0%
SEE ALSO
autovacuum_vacuum_thresholdbloat← back to start
Set per table via ALTER TABLE … SET (autovacuum_vacuum_scale_factor = …). Postgres 18 adds autovacuum_vacuum_max_threshold (default 100M) as a cap on what the formula can demand.
autovacuum_vacuum_scale_factor — robovac