Parameter · Vacuuming / Automatic Vacuuming
autovacuum_vacuum_insert_scale_factor
Number of tuple inserts prior to vacuum as a fraction of reltuples.
- Default:
0.2 - Type: real
- Range: 0 … 100
- Applies: Reload
In plain words
The proportional part of the insert trigger: after inserts equal to 20% of the table (plus 1000), autovacuum vacuums an insert-only table to mark pages visible and freeze rows.
For DBAs and operators
Since PostgreSQL 18 the fraction applies only to the unfrozen part of the table: insert_threshold + insert_scale_factor × reltuples × (1 − relallfrozen/relpages), compared with n_ins_since_vacuum. For big append-only tables (logs, events, time series) that are queried with index-only scans, lower it per table so the visibility map stays current:
ALTER TABLE events SET (autovacuum_vacuum_insert_scale_factor = 0.01);
SELECT relname, n_ins_since_vacuum, last_autovacuum
FROM pg_stat_user_tables ORDER BY n_ins_since_vacuum DESC;
-- heap fetches in EXPLAIN (ANALYZE) of an index-only scan = pages not all-visibleHow 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 Free space map and visibility map
Related parameters
autovacuum_vacuum_insert_threshold autovacuum_vacuum_scale_factor