{"Entry":{"collection":"guc","key":"autovacuum_freeze_max_age","name":"autovacuum_freeze_max_age","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Vacuuming / Automatic Vacuuming","category_zh":"","changed_in":["18"],"changes":[{"documentation_changed":false,"fields":{},"from":"8.1","status":"added","to":"8.2"},{"documentation_changed":true,"fields":{},"from":"8.2","status":"changed","to":"8.3"},{"documentation_changed":true,"fields":{},"from":"8.3","status":"changed","to":"8.4"},{"documentation_changed":true,"fields":{},"from":"8.4","status":"changed","to":"9.0"},{"documentation_changed":true,"fields":{},"from":"9.1","status":"changed","to":"9.2"},{"documentation_changed":true,"fields":{},"from":"9.4","status":"changed","to":"9.5"},{"documentation_changed":true,"fields":{},"from":"9.5","status":"changed","to":"9.6"},{"documentation_changed":true,"fields":{},"from":"9.6","status":"changed","to":"10"},{"documentation_changed":true,"fields":{},"from":"13","status":"changed","to":"14"},{"documentation_changed":true,"fields":{},"from":"16","status":"changed","to":"17"},{"documentation_changed":false,"fields":{"category":{"from":"Autovacuum","to":"Vacuuming / Automatic Vacuuming"}},"from":"17","status":"changed","to":"18"}],"content_hash":"05635abe9de41ec7ca15c1a5b619cc4409fe829b6290b75da4965f1b0ac19469","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"200000000"}],"editorial":{"advice":{"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 autovacuum_freeze_max_age 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."},"mechanism":["Age at which to autovacuum a table to prevent transaction ID wraparound. The value is fixed when the server starts, so changing it requires a restart.","Reaching the max age forces an aggressive autovacuum even if ordinary autovacuum is disabled; a per-table override can only lower the global ceiling. Safety must be assessed across every database/table age together with long transactions and replication slots.","Monitor and change autovacuum_freeze_max_age together with vacuum_freeze_min_age, vacuum_freeze_table_age, vacuum_failsafe_age. Validate on the relevant server role and real workload, then use its postmaster context to choose session change, reload, or restart; a historical boot default is not the current effective value."],"pitfalls":["Converting transaction age to days without using the actual transaction rate.","Raising the ceiling to hide blocked or underprovisioned vacuum.","Monitoring only the current database instead of every database and table.","Changing the global value while a table storage parameter overrides it.","Treating reltuples and cumulative change statistics as exact real-time counts."],"references":[{"title":"PostgreSQL 19 Beta 4: autovacuum_freeze_max_age","url":"https://www.postgresql.org/docs/19/runtime-config-vacuum.html#GUC-AUTOVACUUM-FREEZE-MAX-AGE"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["vacuum_freeze_min_age","vacuum_freeze_table_age","vacuum_failsafe_age","autovacuum_multixact_freeze_max_age","vacuum_multixact_freeze_min_age","vacuum_multixact_freeze_table_age"],"summary":"autovacuum_freeze_max_age — Age at which to autovacuum a table to prevent transaction ID wraparound. Observed in PG9.0–19 Beta 4; its last measured boot default is 200000000 in PG19 Beta 4, with postmaster context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"8.2","group":"Vacuuming","group_slug":"vacuum","imported_at":"2026-09-27T17:57:30.794527+08:00","intro_commit":{},"key":"autovacuum_freeze_max_age","last_version":"20","max_val":"","min_val":"","name":"autovacuum_freeze_max_age","position":20,"present_in":["8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"short_desc":"Specifies the maximum age (in transactions) that a table's pg_class.relfrozenxid field can attain before a VACUUM operation is forced to prevent transaction ID wraparound within the table.","short_desc_zh":"","source_rev":"english-manuals:850bf00b004f47acae96f5879197489badecf22616dbeacfe01fc2dacb2c4418","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"autovacuum_freeze_max_age","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"autovacuum_freeze_max_age","SourceRevision":"english-manuals:850bf00b004f47acae96f5879197489badecf22616dbeacfe01fc2dacb2c4418","Facts":{"boot_val":"200000000","category":"Vacuuming / Automatic Vacuuming","context":"postmaster","description":"Specifies the maximum age (in transactions) that a table's pg_class.relfrozenxid field can attain before a VACUUM operation is forced to prevent transaction ID wraparound within the table. Note that the system will launch autovacuum processes to prevent wraparound even when autovacuum is otherwise disabled. Vacuum also allows removal of old files from the pg_xact subdirectory, which is why the default is a relatively low 200 million transactions. This parameter can only be set at server start, but the setting can be reduced for individual tables by changing table storage parameters. For more information see Section 24.1.5.","doc":{"anchor":"GUC-AUTOVACUUM-FREEZE-MAX-AGE","file":"runtime-config-vacuum.html","lang":"en","sha256":"7047f1fa9138b97f1812532f8a905fa7479451dfd64655e029a7d387b20b22e4","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"2000000000","metadata_version":"18","min_val":"100000","name":"autovacuum_freeze_max_age","short_desc":"Age at which to autovacuum a table to prevent transaction ID wraparound.","source":"pg-settings-source-snapshot","unit":null,"vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-AUTOVACUUM-FREEZE-MAX-AGE","file":"runtime-config-vacuum.html","lang":"en","sha256":"7047f1fa9138b97f1812532f8a905fa7479451dfd64655e029a7d387b20b22e4","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"autovacuum_freeze_max_age","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"autovacuum_freeze_max_age","Summary":"","BodyHTML":"\u003cp\u003e指定在必须强制执行 \u003ccode\u003eVACUUM\u003c/code\u003e 以防止表内事务 ID 回卷之前，一个表的 \u003ccode\u003epg_class\u003c/code\u003e.\u003ccode\u003erelfrozenxid\u003c/code\u003e 字段可以达到的最大年龄（以事务计）。注意即使自动清理被禁用，系统也会启动自动清理进程来防止回卷。\u003c/p\u003e\u003cp\u003e清理也允许从\u003ccode\u003epg_xact\u003c/code\u003e子目录中移除旧文件，这也是为什么默认值被设置为较低的2亿事务。该参数只能在服务器启动时设置，但是对于个别表可以通过修改表存储参数来降低该设置。详见\u003ca href=\"/docs/18/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND\" rel=\"nofollow\"\u003e第 24.1.5 节\u003c/a\u003e。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"fddeb9f0b08052ba463bd2488e309bacc0e98de73bf1ee2baba7c47ddd1052ae","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e指定在必须强制执行 \u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e 以防止表内事务 ID 回卷之前，一个表的 \u003ccode class=\"structname\"\u003epg_class\u003c/code\u003e.\u003ccode class=\"structfield\"\u003erelfrozenxid\u003c/code\u003e 字段可以达到的最大年龄（以事务计）。注意即使自动清理被禁用，系统也会启动自动清理进程来防止回卷。\u003c/p\u003e\u003cp\u003e清理也允许从\u003ccode class=\"filename\"\u003epg_xact\u003c/code\u003e子目录中移除旧文件，这也是为什么默认值被设置为较低的2亿事务。该参数只能在服务器启动时设置，但是对于个别表可以通过修改表存储参数来降低该设置。详见\u003ca href=\"/docs/18/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND\" title=\"24.1.5. 防止事务 ID 回卷失败\"\u003e第 24.1.5 节\u003c/a\u003e。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
