{"Entry":{"collection":"guc","key":"vacuum_cost_limit","name":"vacuum_cost_limit","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Vacuuming / Cost-Based Vacuum Delay","category_zh":"","changed_in":["18"],"changes":[{"documentation_changed":false,"fields":{},"from":"7.4","status":"added","to":"8.0"},{"documentation_changed":true,"fields":{},"from":"16","status":"changed","to":"17"},{"documentation_changed":false,"fields":{"category":{"from":"Resource Usage / Cost-Based Vacuum Delay","to":"Vacuuming / Cost-Based Vacuum Delay"}},"from":"17","status":"changed","to":"18"}],"content_hash":"136ad0c8a479ca6d3360140fe6480d6c27082072bd58f6956a3dba902c0f565b","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"200"}],"editorial":{"advice":{"olap":"During post-load windows, a larger budget or shorter delay can improve maintenance throughput, but verify that scans do not starve queries/imports. Failsafe activation means normal pacing already failed.","oltp":"Tune vacuum_cost_limit from autovacuum duration, dead-tuple growth, and foreground I/O latency together. Prefer per-table overrides for hotspots; global throttling must not let cleanup fall permanently behind.","small":"Keep conservative defaults. On slow disks, lowering concurrency or overriding one table is usually more controllable than making the delay arbitrarily large."},"mechanism":["Vacuum cost amount available before napping. It can be changed at session scope, so different sessions may observe different behavior.","VACUUM accumulates virtual cost for page hits, misses, and dirties; after the balance reaches vacuum_cost_limit it sleeps for vacuum_cost_delay and resets. This is coarse I/O pacing rather than an exact bandwidth cap, and the wraparound failsafe bypasses throttling.","Monitor and change vacuum_cost_limit together with vacuum_cost_delay, vacuum_cost_page_hit, vacuum_cost_page_miss. 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":["Changing the global value while a table storage parameter overrides it.","Treating reltuples and cumulative change statistics as exact real-time counts.","Blaming a threshold without checking long transactions, replication slots, and worker saturation.","Buying short-term quiet by deferring maintenance until wraparound failsafe activates."],"references":[{"title":"PostgreSQL 19 Beta 4: vacuum_cost_limit","url":"https://www.postgresql.org/docs/19/runtime-config-vacuum.html#GUC-VACUUM-COST-LIMIT"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["vacuum_cost_delay","vacuum_cost_page_hit","vacuum_cost_page_miss","vacuum_cost_page_dirty","autovacuum_vacuum_cost_delay","autovacuum_vacuum_cost_limit"],"summary":"vacuum_cost_limit — Vacuum cost amount available before napping. Observed in PG9.0–19 Beta 4; its last measured boot default is 200 in PG19 Beta 4, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"8.0","group":"Vacuuming","group_slug":"vacuum","imported_at":"2026-09-27T17:57:32.270295+08:00","intro_commit":{},"key":"vacuum_cost_limit","last_version":"20","max_val":"","min_val":"","name":"vacuum_cost_limit","position":447,"present_in":["8.0","8.1","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":"This is the accumulated cost that will cause the vacuuming process to sleep for vacuum_cost_delay.","short_desc_zh":"","source_rev":"english-manuals:dca6706b11c7a12537834d3d457bbabded3f9c146b1db0c87c40951f0d140d09","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"vacuum_cost_limit","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"vacuum_cost_limit","SourceRevision":"english-manuals:dca6706b11c7a12537834d3d457bbabded3f9c146b1db0c87c40951f0d140d09","Facts":{"boot_val":"200","category":"Vacuuming / Cost-Based Vacuum Delay","context":"user","description":"This is the accumulated cost that will cause the vacuuming process to sleep for vacuum_cost_delay. The default is 200.","doc":{"anchor":"GUC-VACUUM-COST-LIMIT","file":"runtime-config-vacuum.html","lang":"en","sha256":"7047f1fa9138b97f1812532f8a905fa7479451dfd64655e029a7d387b20b22e4","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"10000","metadata_version":"18","min_val":"1","name":"vacuum_cost_limit","short_desc":"Vacuum cost amount available before napping.","source":"pg-settings-source-snapshot","unit":null,"vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-VACUUM-COST-LIMIT","file":"runtime-config-vacuum.html","lang":"en","sha256":"7047f1fa9138b97f1812532f8a905fa7479451dfd64655e029a7d387b20b22e4","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"vacuum_cost_limit","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"vacuum_cost_limit","Summary":"","BodyHTML":"\u003cp\u003e会使清理进程休眠 \u003ccode\u003evacuum_cost_delay\u003c/code\u003e 指定时长的累计代价。默认值为 \u003ccode\u003e200\u003c/code\u003e。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"82b43ffc847cd97a515565b23b44cd434adb75056b85e95279470252ca7233da","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e会使清理进程休眠 \u003ccode class=\"varname\"\u003evacuum_cost_delay\u003c/code\u003e 指定时长的累计代价。默认值为 \u003ccode class=\"literal\"\u003e200\u003c/code\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.0","8.1","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}
