Configuration parameter

vacuum_freeze_min_age — PostgreSQL configuration parameter

Category Vacuuming Default 50 million transactions

Specifies the cutoff age (in transactions) that VACUUM should use to decide whether to trigger freezing of pages that have an older XID.

At a glance

Property Value
Parameter vacuum_freeze_min_age
Category Vacuuming
Default 50
Value type integer
Change scope Per-session (SET)
Available in PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12)

What it does

Specifies the cutoff age (in transactions) that VACUUM should use to decide whether to trigger freezing of pages that have an older XID. The default is 50 million transactions. Although users can set this value anywhere from zero to one billion, VACUUM will silently limit the effective value to half the value of autovacuum_freeze_max_age, so that there is not an unreasonably short time between forced autovacuums. For more information see vacuum_for_wraparound.

(Description quoted from the official PostgreSQL documentation.)

How to apply a change

Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.

Inspect the current value and source with SHOW vacuum_freeze_min_age; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'vacuum_freeze_min_age';.

Tuning guidance

Lower it to freeze tuples sooner (more freeze work, spread out); raise it to defer freezing and reduce churn on frequently-updated tables. Coordinate with vacuum_freeze_table_age to avoid wraparound surprises.

Reference

PostgreSQL documentation — vacuum_freeze_min_age.

Keep going

Related & next steps

Was this helpful?

← All configuration parameters