{"Entry":{"collection":"guc","key":"vacuum_failsafe_age","name":"vacuum_failsafe_age","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Vacuuming / Freezing","category_zh":"","changed_in":["18"],"changes":[{"documentation_changed":false,"fields":{},"from":"13","status":"added","to":"14"},{"documentation_changed":true,"fields":{},"from":"15","status":"changed","to":"16"},{"documentation_changed":false,"fields":{"category":{"from":"Client Connection Defaults / Statement Behavior","to":"Vacuuming / Freezing"}},"from":"17","status":"changed","to":"18"}],"content_hash":"570fafcc0f16910fafe968cfe10331278454edfa72588040cd33a0d93c48f2d4","context":"","default_changed_in":[],"default_history":[{"from":"14","to":"19","value":"1600000000"}],"derived_content_hash":"f35be57cc0f67839c3b9da1612c1d926eae51b029dd8816f87a2064a09c05485","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:7508752469e25373a805a69bf3a8fa680e75c05bd64d1a62a723d9953cf71505","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"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 vacuum_failsafe_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 VACUUM should trigger failsafe to avoid a wraparound outage. It can be changed at session scope, so different sessions may observe different behavior.","At the failsafe age, a running VACUUM prioritizes advancing the freeze horizon quickly: cost delays stop and optional work such as index cleanup and tail truncation is skipped. This is a last defense against wraparound outage, not a routine performance mode.","Monitor and change vacuum_failsafe_age together with autovacuum_freeze_max_age, vacuum_freeze_min_age, vacuum_freeze_table_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."],"pitfalls":["Treating failsafe as a normal high-throughput VACUUM mode.","Ignoring skipped index cleanup after the emergency has passed.","Raising the age to suppress evidence of a maintenance failure.","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: vacuum_failsafe_age","url":"https://www.postgresql.org/docs/19/runtime-config-vacuum.html#GUC-VACUUM-FAILSAFE-AGE"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["autovacuum_freeze_max_age","vacuum_freeze_min_age","vacuum_freeze_table_age","autovacuum_multixact_freeze_max_age","vacuum_multixact_freeze_min_age","vacuum_multixact_freeze_table_age"],"summary":"vacuum_failsafe_age sets the age at which VACUUM should trigger failsafe to avoid a wraparound outage. It is a user setting present in PG14–18; the latest recorded boot default is 1600000000."},"enumvals":[],"first_version":"14","group":"Vacuuming","group_slug":"vacuum","imported_at":"2026-09-27T17:57:32.286077+08:00","intro_commit":{"authored_at":"2021-04-07T12:37:45-07:00","discussion":["https://postgr.es/m/CAD21AoD0SkE11fMw4jD4RENAwBMcw1wasVnwpJVw3tVqPOQgAw@mail.gmail.com","https://postgr.es/m/CAH2-WzmgH3ySGYeC-m-eOBsa2=sDwa292-CFghV4rESYo39FsQ@mail.gmail.com"],"hash":"1e55e7d1755cefbb44982fbacc7da461fa8684e6","subject":"Add wraparound failsafe to VACUUM.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=1e55e7d1755cefbb44982fbacc7da461fa8684e6"},"key":"vacuum_failsafe_age","last_version":"20","max_val":"","min_val":"","name":"vacuum_failsafe_age","position":452,"present_in":["14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"english-manuals:3c2b40df525de3a8ae84f869b8f73f68bb56d0229b9a098ace6a684a2de2ea1c","receipt_sha256":"f68fc3c5ba7d45ef8f9251d0ec916d05d0abd912c139cff1fda82f65cdbdcafa","repair":"wiki-repair-20261023"},"short_desc":"Specifies the maximum age (in transactions) that a table's pg_class.relfrozenxid field can attain before VACUUM takes extraordinary measures to avoid system-wide transaction ID wraparound failure.","short_desc_zh":"","source_rev":"wiki-repair-20261023:7508752469e25373a805a69bf3a8fa680e75c05bd64d1a62a723d9953cf71505","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"vacuum_failsafe_age","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"vacuum_failsafe_age","SourceRevision":"wiki-repair-20261023:7508752469e25373a805a69bf3a8fa680e75c05bd64d1a62a723d9953cf71505","Facts":{"boot_val":"1600000000","category":"Vacuuming / Freezing","context":"user","description":"Specifies the maximum age (in transactions) that a table's pg_class.relfrozenxid field can attain before VACUUM takes extraordinary measures to avoid system-wide transaction ID wraparound failure. This is VACUUM's strategy of last resort. The failsafe typically triggers when an autovacuum to prevent transaction ID wraparound has already been running for some time, though it's possible for the failsafe to trigger during any VACUUM. When the failsafe is triggered, any cost-based delay that is in effect will no longer be applied, further non-essential maintenance tasks (such as index vacuuming) are bypassed, and any Buffer Access Strategy in use will be disabled resulting in VACUUM being free to make use of all of shared buffers. The default is 1.6 billion transactions. Although users can set this value anywhere from zero to 2.1 billion, VACUUM will silently adjust the effective value to no less than 105% of autovacuum_freeze_max_age.","description_zh":"指定表的 pg_class.relfrozenxid 字段在 VACUUM 采取非常措施以避免系统范围事务 ID 回卷失败之前所允许达到的最大年龄（以事务数计）。这是 VACUUM 的最后手段。失效保护通常会在为防止事务 ID 回卷而启动的自动清理已经运行一段时间后触发，但也可能在任何一次 VACUUM 期间触发。 当触发失效保护时，当前生效的任何基于代价的延迟都将不再应用，进一步的非关键维护任务（例如索引清理）会被跳过，并且正在使用的任何缓冲区访问策略都会被禁用，从而使 VACUUM 可以自由使用全部共享缓冲区。 默认值为 16 亿个事务。尽管用户可以将该值设置在 0 到 21 亿之间，VACUUM 仍会悄悄将其有效值调整为不低于 autovacuum_freeze_max_age 的 105%。","description_zh_html":"\u003cp\u003e\n        指定表的 \u003ccode class=\"structname\"\u003epg_class\u003c/code\u003e.\u003ccode class=\"structfield\"\u003erelfrozenxid\u003c/code\u003e 字段在 \u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e 采取非常措施以避免系统范围事务 ID 回卷失败之前所允许达到的最大年龄（以事务数计）。这是 \u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e 的最后手段。失效保护通常会在为防止事务 ID 回卷而启动的自动清理已经运行一段时间后触发，但也可能在任何一次 \u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e 期间触发。\n       \u003c/p\u003e\u003cp\u003e\n        当触发失效保护时，当前生效的任何基于代价的延迟都将不再应用，进一步的非关键维护任务（例如索引清理）会被跳过，并且正在使用的任何\u003ca class=\"glossterm\" href=\"/zh/docs/18/glossary.html#GLOSSARY-BUFFER-ACCESS-STRATEGY\"\u003e\u003cem class=\"glossterm\"\u003e\u003ca class=\"glossterm\" href=\"/zh/docs/18/glossary.html#GLOSSARY-BUFFER-ACCESS-STRATEGY\" title=\"缓冲区访问策略\"\u003e缓冲区访问策略\u003c/a\u003e\u003c/em\u003e\u003c/a\u003e都会被禁用，从而使 \u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e 可以自由使用全部\u003ca class=\"glossterm\" href=\"/zh/docs/18/glossary.html#GLOSSARY-SHARED-MEMORY\"\u003e\u003cem class=\"glossterm\"\u003e\u003ca class=\"glossterm\" href=\"/zh/docs/18/glossary.html#GLOSSARY-SHARED-MEMORY\" title=\"共享内存\"\u003e共享缓冲区\u003c/a\u003e\u003c/em\u003e\u003c/a\u003e。\n       \u003c/p\u003e\u003cp\u003e\n        默认值为 16 亿个事务。尽管用户可以将该值设置在 0 到 21 亿之间，\u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e 仍会悄悄将其有效值调整为不低于 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-vacuum.html#GUC-AUTOVACUUM-FREEZE-MAX-AGE\"\u003eautovacuum_freeze_max_age\u003c/a\u003e 的 105%。\n       \u003c/p\u003e","doc":{"anchor":"GUC-VACUUM-FAILSAFE-AGE","file":"runtime-config-vacuum.html","lang":"en","sha256":"599d3819c5fa60f160ba633df604ee9afd85549ffad2ae2fb0c3132a00d47417","slug":"18"},"doc_html":"\u003cp\u003e\n         Specifies the maximum age (in transactions) that a table's\n         \u003ccode class=\"structname\"\u003epg_class\u003c/code\u003e.\u003ccode class=\"structfield\"\u003erelfrozenxid\u003c/code\u003e\n         field can attain before \u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e takes\n         extraordinary measures to avoid system-wide transaction ID\n         wraparound failure.  This is \u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e's\n         strategy of last resort.  The failsafe typically triggers\n         when an autovacuum to prevent transaction ID wraparound has\n         already been running for some time, though it's possible for\n         the failsafe to trigger during any \u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e.\n        \u003c/p\u003e\u003cp\u003e\n         When the failsafe is triggered, any cost-based delay that is\n         in effect will no longer be applied, further non-essential\n         maintenance tasks (such as index vacuuming) are bypassed, and any\n         \u003ca class=\"glossterm\" href=\"/docs/18/glossary.html#GLOSSARY-BUFFER-ACCESS-STRATEGY\"\u003e\u003cem class=\"glossterm\"\u003e\u003ca class=\"glossterm\" href=\"/docs/18/glossary.html#GLOSSARY-BUFFER-ACCESS-STRATEGY\" title=\"Buffer Access Strategy\"\u003eBuffer Access Strategy\u003c/a\u003e\u003c/em\u003e\u003c/a\u003e\n         in use will be disabled resulting in \u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e being\n         free to make use of all of\n         \u003ca class=\"glossterm\" href=\"/docs/18/glossary.html#GLOSSARY-SHARED-MEMORY\"\u003e\u003cem class=\"glossterm\"\u003e\u003ca class=\"glossterm\" href=\"/docs/18/glossary.html#GLOSSARY-SHARED-MEMORY\" title=\"Shared memory\"\u003eshared buffers\u003c/a\u003e\u003c/em\u003e\u003c/a\u003e.\n        \u003c/p\u003e\u003cp\u003e\n         The default is 1.6 billion transactions.  Although users can\n         set this value anywhere from zero to 2.1 billion,\n         \u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e will silently adjust the effective\n         value to no less than 105% of \u003ca class=\"xref\" href=\"/docs/18/runtime-config-vacuum.html#GUC-AUTOVACUUM-FREEZE-MAX-AGE\"\u003eautovacuum_freeze_max_age\u003c/a\u003e.\n        \u003c/p\u003e","doc_same_as":"","documentation_revision":{"inputs":[{"file":"runtime-config-vacuum.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"599d3819c5fa60f160ba633df604ee9afd85549ffad2ae2fb0c3132a00d47417","version":"18.7"},{"file":"runtime-config-vacuum.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"b835e4b6c446cfdaf673750aba29ba28fc55ef6cc0c531558c1e394fdc05a140","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"2100000000","metadata_version":"18","min_val":"0","name":"vacuum_failsafe_age","short_desc":"Age at which VACUUM should trigger failsafe to avoid a wraparound outage.","source":"pg-settings-source-snapshot","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-vacuum.html","sha256":"ea621aa6ed500fc56d21868a21fd313872cec24b86caf4c8f9bdfdc804b8235f"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"integer","zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"GUC-VACUUM-FAILSAFE-AGE","file":"runtime-config-vacuum.html","lang":"en","sha256":"599d3819c5fa60f160ba633df604ee9afd85549ffad2ae2fb0c3132a00d47417","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"vacuum_failsafe_age","SourceDatabase":"center","Version":"18","Locale":"en","Title":"vacuum_failsafe_age","Summary":"Specifies the maximum age (in transactions) that a table's pg_class.relfrozenxid field can attain before VACUUM takes extraordinary measures to avoid system-wide transaction ID wraparound failure. This is VACUUM's strategy of last resort. The failsafe typically triggers when an autovacuum to prevent transaction ID wraparound has already been running for some time, though it's possible for the failsafe to trigger during any VACUUM. When the failsafe is triggered, any cost-based delay that is in effect will no longer be applied, further non-essential maintenance tasks (such as index vacuuming) are bypassed, and any Buffer Access Strategy in use will be disabled resulting in VACUUM being free to make use of all of shared buffers. The default is 1.6 billion transactions. Although users can set this value anywhere from zero to 2.1 billion, VACUUM will silently adjust the effective value to no less than 105% of autovacuum_freeze_max_age.","BodyHTML":"\u003cp\u003e\n         Specifies the maximum age (in transactions) that a table\u0026#39;s\n         \u003ccode\u003epg_class\u003c/code\u003e.\u003ccode\u003erelfrozenxid\u003c/code\u003e\n         field can attain before \u003ccode\u003eVACUUM\u003c/code\u003e takes\n         extraordinary measures to avoid system-wide transaction ID\n         wraparound failure.  This is \u003ccode\u003eVACUUM\u003c/code\u003e\u0026#39;s\n         strategy of last resort.  The failsafe typically triggers\n         when an autovacuum to prevent transaction ID wraparound has\n         already been running for some time, though it\u0026#39;s possible for\n         the failsafe to trigger during any \u003ccode\u003eVACUUM\u003c/code\u003e.\n        \u003c/p\u003e\u003cp\u003e\n         When the failsafe is triggered, any cost-based delay that is\n         in effect will no longer be applied, further non-essential\n         maintenance tasks (such as index vacuuming) are bypassed, and any\n         \u003ca href=\"/docs/18/glossary.html#GLOSSARY-BUFFER-ACCESS-STRATEGY\" rel=\"nofollow\"\u003e\u003cem\u003e\u003ca href=\"/docs/18/glossary.html#GLOSSARY-BUFFER-ACCESS-STRATEGY\" title=\"Buffer Access Strategy\" rel=\"nofollow\"\u003eBuffer Access Strategy\u003c/a\u003e\u003c/em\u003e\u003c/a\u003e\n         in use will be disabled resulting in \u003ccode\u003eVACUUM\u003c/code\u003e being\n         free to make use of all of\n         \u003ca href=\"/docs/18/glossary.html#GLOSSARY-SHARED-MEMORY\" rel=\"nofollow\"\u003e\u003cem\u003e\u003ca href=\"/docs/18/glossary.html#GLOSSARY-SHARED-MEMORY\" title=\"Shared memory\" rel=\"nofollow\"\u003eshared buffers\u003c/a\u003e\u003c/em\u003e\u003c/a\u003e.\n        \u003c/p\u003e\u003cp\u003e\n         The default is 1.6 billion transactions.  Although users can\n         set this value anywhere from zero to 2.1 billion,\n         \u003ccode\u003eVACUUM\u003c/code\u003e will silently adjust the effective\n         value to no less than 105% of \u003ca href=\"/docs/18/runtime-config-vacuum.html#GUC-AUTOVACUUM-FREEZE-MAX-AGE\" rel=\"nofollow\"\u003eautovacuum_freeze_max_age\u003c/a\u003e.\n        \u003c/p\u003e","SourceRevision":"wiki-repair-20261023:7508752469e25373a805a69bf3a8fa680e75c05bd64d1a62a723d9953cf71505","ContentHash":"f523c96c463c05b8cb98288704efd87ed8234af105218c84c9c1401221432825","Payload":{"description":"Specifies the maximum age (in transactions) that a table's pg_class.relfrozenxid field can attain before VACUUM takes extraordinary measures to avoid system-wide transaction ID wraparound failure. This is VACUUM's strategy of last resort. The failsafe typically triggers when an autovacuum to prevent transaction ID wraparound has already been running for some time, though it's possible for the failsafe to trigger during any VACUUM. When the failsafe is triggered, any cost-based delay that is in effect will no longer be applied, further non-essential maintenance tasks (such as index vacuuming) are bypassed, and any Buffer Access Strategy in use will be disabled resulting in VACUUM being free to make use of all of shared buffers. The default is 1.6 billion transactions. Although users can set this value anywhere from zero to 2.1 billion, VACUUM will silently adjust the effective value to no less than 105% of autovacuum_freeze_max_age."}},"RequestedLocale":"en","Fallback":false,"Versions":["14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
