vacuum_max_eager_freeze_failure_rate
Read PG 18 manual ↗Specifies the maximum number of pages (as a fraction of total pages in the relation) that VACUUM may scan and fail to set all-frozen in the visibility map before disabling eager scanning.
- Type
- real
- Context
- user
- Measured default
- 0.03
- Unit
- —
- Metadata snapshot
- 18
Definition PG 18 manual
Specifies the maximum number of pages (as a fraction of total pages in the relation) that VACUUM may scan and fail to set all-frozen in the visibility map before disabling eager scanning. A value of 0 disables eager scanning altogether. The default is 0.03 (3%).
Note that when eager scanning is enabled, only freeze failures count against the cap, not successful freezing. Successful page freezes are capped internally at 20% of the all-visible but not all-frozen pages in the relation. Capping successful page freezes helps amortize the overhead across multiple normal vacuums and limits the potential downside of wasted eager freezes of pages that are modified again before the next aggressive vacuum.
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 the corresponding table storage parameter. For more information on tuning vacuum's freezing behavior, see Section 24.1.5.
Measured default history
| Version interval | Default |
|---|---|
| 18 – 19 | 0.03 |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
How it works
Fraction of pages in a relation vacuum can scan and fail to freeze before disabling eager scanning. It can be changed at session scope, so different sessions may observe different behavior.
PG18 ordinary VACUUM may eagerly scan all-visible pages that are not all-frozen; it stops that extra work when the fraction scanned without successful freezing grows too high. Raising the rate can shrink later aggressive scans at the cost of more current I/O.
Monitor and change vacuum_max_eager_freeze_failure_rate together with vacuum_truncate, vacuum_freeze_table_age, autovacuum_freeze_max_age. Validate on the relevant server role and real workload, then use its user context to choose session change, reload, or restart; a historical boot default is not the current effective value.
Operational considerations
Treating the value as a percentage integer instead of a fraction between zero and one.
Raising it and increasing scans of all-visible pages without measuring added I/O and WAL.
Assuming eager freezing eliminates the need for periodic aggressive VACUUM.
Ignoring a table-level storage-parameter override.
Judging success only by pages scanned instead of pages actually frozen and future aggressive-scan work.
Workload guidance
OLAP: Proactively VACUUM (FREEZE) newly loaded or static partitions in batch windows and reserve I/O time for full scans. Convert age budgets using peak transaction rate, not a wall-clock guess.
OLTP: Calibrate vacuum_max_eager_freeze_failure_rate against the oldest XID/MXID age in every database and measured vacuum completion rate. Remove long transactions, stale slots, and blocked workers; never raise ages merely to hide a backlog.
SMALL: Upstream defaults are usually safest. A small system still needs anti-wraparound maintenance; monitor every database, not only the application database.
Version history 1
- PG 17 → 18added
Related entries
Further reading
Definition snapshot: english-manuals:98d8b6d368fd910d06cf6e20b00… · English manual source