autovacuum_vacuum_scale_factor
Read PG 18 manual ↗Specifies a fraction of the table size to add to autovacuum_vacuum_threshold when deciding whether to trigger a VACUUM.
- Type
- real
- Context
- sighup
- Measured default
- 0.2
- Unit
- —
- Metadata snapshot
- 18
Definition PG 18 manual
Specifies a fraction of the table size to add to autovacuum_vacuum_threshold when deciding whether to trigger a VACUUM. The default is 0.2 (20% of table size). This parameter can only be set in the postgresql.conf file or on the server command line; but the setting can be overridden for individual tables by changing table storage parameters.
Measured default history
| Version interval | Default |
|---|---|
| 9.0 – 19 | 0.2 |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
How it works
The core trigger is the base threshold plus this factor multiplied by pg_class.reltuples, an approximate row count. In PostgreSQL 18 the result is also capped by autovacuum_vacuum_max_threshold.
This trigger counts tuples made obsolete by UPDATE or DELETE; insert-driven vacuuming has its own threshold and scale factor. Anti-wraparound vacuuming is governed by transaction-age rules and can run independently of this setting.
A table-level autovacuum_vacuum_scale_factor storage parameter overrides the global value, which is often preferable when table sizes and update rates vary widely.
Operational considerations
A percentage that looks small can still represent millions of dead tuples on a large table.
Lowering the factor globally can create continuous I/O pressure across many tables.
It does not control insert-triggered vacuuming or anti-wraparound vacuuming.
reltuples is an estimate, so the trigger is not an exact dead-row percentage.
Table storage parameters can silently make the global value irrelevant for that table.
Workload guidance
OLAP: For append-and-batch workloads, coordinate the threshold with load cycles and explicit VACUUM/ANALYZE. A low global factor can create unwanted maintenance during bulk jobs.
OLTP: Use lower per-table values on large, update-heavy tables so dead tuples do not accumulate into a large absolute backlog. Validate with table churn and vacuum duration rather than selecting a percentage in isolation.
SMALL: The upstream default is often adequate for genuinely small tables. Tune exceptions per table; a low cluster-wide value can create frequent tiny vacuums.
Version history 2
- PG 17 → 18changed
- PG 9.4 → 9.5changed
Related entries
Further reading
Definition snapshot: english-manuals:daec2d91dcc904901e13712a3cf… · English manual source