{"Entry":{"collection":"guc","key":"vacuum_max_eager_freeze_failure_rate","name":"vacuum_max_eager_freeze_failure_rate","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Vacuuming / Freezing","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"17","status":"added","to":"18"}],"content_hash":"d14b1e3c161790ceddbbdb1705cf68b390d5a34cfb164d7f9d8fa1e97ab7f0ae","context":"","default_changed_in":[],"default_history":[{"from":"18","to":"19","value":"0.03"}],"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_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."},"mechanism":["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."],"pitfalls":["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."],"references":[{"title":"PostgreSQL 19 Beta 4: vacuum_max_eager_freeze_failure_rate","url":"https://www.postgresql.org/docs/19/runtime-config-vacuum.html#GUC-VACUUM-MAX-EAGER-FREEZE-FAILURE-RATE"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["vacuum_truncate","vacuum_freeze_table_age","autovacuum_freeze_max_age","maintenance_work_mem","vacuum_failsafe_age","vacuum_freeze_min_age"],"summary":"vacuum_max_eager_freeze_failure_rate — Fraction of pages in a relation vacuum can scan and fail to freeze before disabling eager scanning. Observed in PG18–19 Beta 4; its last measured boot default is 0.03 in PG19 Beta 4, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"18","group":"Vacuuming","group_slug":"vacuum","imported_at":"2026-09-27T17:57:32.295254+08:00","intro_commit":{"authored_at":"2025-02-11T13:52:19-05:00","discussion":["https://postgr.es/m/flat/CAAKRu_ZF_KCzZuOrPrOqjGVe8iRVWEAJSpzMgRQs%3D5-v84cXUg%40mail.gmail.com"],"hash":"052026c9b903380b428a4c9ba2ec90726db81288","subject":"Eagerly scan all-visible pages to amortize aggressive vacuum","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=052026c9b903380b428a4c9ba2ec90726db81288"},"key":"vacuum_max_eager_freeze_failure_rate","last_version":"20","max_val":"","min_val":"","name":"vacuum_max_eager_freeze_failure_rate","position":455,"present_in":["18","19","20"],"short_desc":"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.","short_desc_zh":"","source_rev":"english-manuals:2a59546c0fe07b0df0d092a60ac57a84d16b54d816e874f2825255eacd5feb94","unit":"","vartype":"real"}},"Definition":{"Collection":"guc","Key":"vacuum_max_eager_freeze_failure_rate","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"vacuum_max_eager_freeze_failure_rate","SourceRevision":"english-manuals:2a59546c0fe07b0df0d092a60ac57a84d16b54d816e874f2825255eacd5feb94","Facts":{"boot_val":"0.03","category":"Vacuuming / Freezing","context":"user","description":"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.","doc":{"anchor":"GUC-VACUUM-MAX-EAGER-FREEZE-FAILURE-RATE","file":"runtime-config-vacuum.html","lang":"en","sha256":"7047f1fa9138b97f1812532f8a905fa7479451dfd64655e029a7d387b20b22e4","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"A value of 0.0 disables eager scanning and a value of 1.0 will eagerly scan up to 100 percent of the all-visible pages in the relation. If vacuum successfully freezes these pages, the cap is lower than 100 percent, because the goal is to amortize page freezing across multiple vacuums.","lang":"en","max_val":"1","metadata_version":"18","min_val":"0","name":"vacuum_max_eager_freeze_failure_rate","short_desc":"Fraction of pages in a relation vacuum can scan and fail to freeze before disabling eager scanning.","source":"pg-settings-source-snapshot","unit":null,"vartype":"real"},"ManualEvidence":{"doc":{"anchor":"GUC-VACUUM-MAX-EAGER-FREEZE-FAILURE-RATE","file":"runtime-config-vacuum.html","lang":"en","sha256":"7047f1fa9138b97f1812532f8a905fa7479451dfd64655e029a7d387b20b22e4","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"vacuum_max_eager_freeze_failure_rate","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"vacuum_max_eager_freeze_failure_rate","Summary":"","BodyHTML":"\u003cp\u003e指定\u003ccode\u003eVACUUM\u003c/code\u003e在急切扫描模式下可以扫描但\u003cspan\u003e\u003cem\u003e未能\u003c/em\u003e\u003c/span\u003e在可见性映射中设置为 all-frozen 的页面数量占整个关系总页面数的比例，超过该比例后就会禁用急切扫描。值\u003ccode\u003e0\u003c/code\u003e表示完全禁用急切扫描。默认值为\u003ccode\u003e0.03\u003c/code\u003e（3%）。\u003c/p\u003e\u003cp\u003e请注意，当急切扫描启用时，只有冻结失败才会计入上限，成功的冻结不会计入。成功冻结的页面在内部会被限制为关系中所有 all-visible 但未 all-frozen 页面数的 20%。对成功冻结页面设置上限有助于将成本分摊到多次常规清理中，并限制在下次激进清理之前页面再次被修改时急切冻结可能带来的浪费。\u003c/p\u003e\u003cp\u003e这个参数只能在\u003ccode\u003epostgresql.conf\u003c/code\u003e文件中或服务器命令行上设置；但也可以通过修改\u003ca href=\"/docs/18/sql-createtable.html#RELOPTION-VACUUM-MAX-EAGER-FREEZE-FAILURE-RATE\" rel=\"nofollow\"\u003e对应的表存储参数\u003c/a\u003e为单个表覆盖该设置。关于调整清理冻结行为的更多信息，见\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":"6c529d905ad2ea2c85e2aa4c3d5b50ad179af602109a779b7f40c43af94ea8a8","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e指定\u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e在急切扫描模式下可以扫描但\u003cspan class=\"emphasis\"\u003e\u003cem\u003e未能\u003c/em\u003e\u003c/span\u003e在可见性映射中设置为 all-frozen 的页面数量占整个关系总页面数的比例，超过该比例后就会禁用急切扫描。值\u003ccode class=\"literal\"\u003e0\u003c/code\u003e表示完全禁用急切扫描。默认值为\u003ccode class=\"literal\"\u003e0.03\u003c/code\u003e（3%）。\u003c/p\u003e\u003cp\u003e请注意，当急切扫描启用时，只有冻结失败才会计入上限，成功的冻结不会计入。成功冻结的页面在内部会被限制为关系中所有 all-visible 但未 all-frozen 页面数的 20%。对成功冻结页面设置上限有助于将成本分摊到多次常规清理中，并限制在下次激进清理之前页面再次被修改时急切冻结可能带来的浪费。\u003c/p\u003e\u003cp\u003e这个参数只能在\u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e文件中或服务器命令行上设置；但也可以通过修改\u003ca href=\"/docs/18/sql-createtable.html#RELOPTION-VACUUM-MAX-EAGER-FREEZE-FAILURE-RATE\"\u003e对应的表存储参数\u003c/a\u003e为单个表覆盖该设置。关于调整清理冻结行为的更多信息，见\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":["18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
