{"Entry":{"collection":"guc","key":"vacuum_cost_page_hit","name":"vacuum_cost_page_hit","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":"8.1","status":"changed","to":"8.2"},{"documentation_changed":true,"fields":{"category":{"from":"Resource Usage / Cost-Based Vacuum Delay","to":"Vacuuming / Cost-Based Vacuum Delay"}},"from":"17","status":"changed","to":"18"}],"content_hash":"326023a2eb31e0d4b3c4e176e828435551b639ed697e63b35a035994f9f6290a","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"1"}],"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_page_hit 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 for a page found in the buffer cache. 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_page_hit together with vacuum_cost_delay, vacuum_cost_limit, 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_page_hit","url":"https://www.postgresql.org/docs/19/runtime-config-vacuum.html#GUC-VACUUM-COST-PAGE-HIT"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["vacuum_cost_delay","vacuum_cost_limit","vacuum_cost_page_miss","vacuum_cost_page_dirty","autovacuum_vacuum_cost_delay","autovacuum_vacuum_cost_limit"],"summary":"vacuum_cost_page_hit — Vacuum cost for a page found in the buffer cache. Observed in PG9.0–19 Beta 4; its last measured boot default is 1 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.276668+08:00","intro_commit":{},"key":"vacuum_cost_page_hit","last_version":"20","max_val":"","min_val":"","name":"vacuum_cost_page_hit","position":449,"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":"The estimated cost for vacuuming a buffer found in the shared buffer cache.","short_desc_zh":"","source_rev":"english-manuals:009528aa963bb970c942d6293575da542277979a6b7b844a54ba180c60156f52","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"vacuum_cost_page_hit","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"vacuum_cost_page_hit","SourceRevision":"english-manuals:009528aa963bb970c942d6293575da542277979a6b7b844a54ba180c60156f52","Facts":{"boot_val":"1","category":"Vacuuming / Cost-Based Vacuum Delay","context":"user","description":"The estimated cost for vacuuming a buffer found in the shared buffer cache. It represents the cost to lock the buffer pool, lookup the shared hash table and scan the content of the page. The default value is 1.","doc":{"anchor":"GUC-VACUUM-COST-PAGE-HIT","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":"0","name":"vacuum_cost_page_hit","short_desc":"Vacuum cost for a page found in the buffer cache.","source":"pg-settings-source-snapshot","unit":null,"vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-VACUUM-COST-PAGE-HIT","file":"runtime-config-vacuum.html","lang":"en","sha256":"7047f1fa9138b97f1812532f8a905fa7479451dfd64655e029a7d387b20b22e4","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"vacuum_cost_page_hit","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"vacuum_cost_page_hit","Summary":"","BodyHTML":"\u003cp\u003e清理在共享缓冲区缓存中找到的缓冲区时所计入的估算代价。它表示锁定缓冲池、查找共享 hash 表和扫描页内容的代价。默认值为 \u003ccode\u003e1\u003c/code\u003e。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"d5d9e0d089a5d24d52e71093666cba61c2aaf371a726efb513c42b2706c176c2","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e清理在共享缓冲区缓存中找到的缓冲区时所计入的估算代价。它表示锁定缓冲池、查找共享 hash 表和扫描页内容的代价。默认值为 \u003ccode class=\"literal\"\u003e1\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}
