{"Entry":{"collection":"guc","key":"track_cost_delay_timing","name":"track_cost_delay_timing","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Statistics / Cumulative Query and Index Statistics","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"17","status":"added","to":"18"}],"content_hash":"5304670b1dfdbedfd0c8a75941e461cc0f38f74b540dc3f97926c56cc396a5da","context":"","default_changed_in":[],"default_history":[{"from":"18","to":"19","value":"off"}],"editorial":{"advice":{"olap":"It is useful when long maintenance overlaps analytical work and throttle time must be quantified. Compare reported delay time with maintenance duration and foreground latency, then keep it on only if the evidence is used operationally.","oltp":"Enable it when operators need to distinguish VACUUM or ANALYZE work from intentional cost-delay sleep. Measure clock-read overhead with pg_test_timing and under autovacuum load; it is a boolean and does not size or enable cost-based delay itself.","small":"Leave off unless vacuum-delay diagnostics are needed and clock reads are cheap on the platform. Enabling it does not make maintenance faster or slower by policy; vacuum_cost_* settings remain separate."},"mechanism":["track_cost_delay_timing measures time actually spent in cost-based VACUUM and ANALYZE delay. The result appears in progress views, verbose command output, and eligible autovacuum logs.","Collection repeatedly reads the operating-system clock and can have platform-dependent overhead. It does not enable vacuum delay or alter vacuum_cost_* policy.","The metric helps distinguish useful work from intentional throttling. pg_test_timing can measure clock-read overhead before enabling it widely. Its superuser context permits an authorized session change without a server restart."],"pitfalls":["Assuming the switch enables cost-based vacuum delay rather than only timing existing delay.","Ignoring platform-dependent clock-read overhead instead of measuring with pg_test_timing.","Looking for the metric without enabling the relevant progress, verbose, or autovacuum-log output.","Treating the boolean as a duration or buffer-size parameter."],"references":[{"title":"PostgreSQL 19 Beta 4: track_cost_delay_timing","url":"https://www.postgresql.org/docs/19/runtime-config-statistics.html#GUC-TRACK-COST-DELAY-TIMING"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["vacuum_cost_delay","autovacuum_vacuum_cost_delay","log_autovacuum_min_duration","track_io_timing","vacuum_buffer_usage_limit"],"summary":"track_cost_delay_timing — Collects timing statistics for cost-based vacuum delay. Observed in PG18–19 Beta 4; its last measured boot default is off in PG19 Beta 4, with superuser context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"18","group":"Statistics","group_slug":"statistics","imported_at":"2026-09-27T17:57:32.211485+08:00","intro_commit":{"authored_at":"2025-02-11T16:38:14-06:00","discussion":["https://postgr.es/m/ZmaXmWDL829fzAVX%40ip-10-97-1-34.eu-west-3.compute.internal"],"hash":"bb8dff9995f2cf501376772898bcbcf58aa05cde","subject":"Add cost-based vacuum delay time to progress views.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=bb8dff9995f2cf501376772898bcbcf58aa05cde"},"key":"track_cost_delay_timing","last_version":"20","max_val":"","min_val":"","name":"track_cost_delay_timing","position":428,"present_in":["18","19","20"],"short_desc":"Enables timing of cost-based vacuum delay (see Section 19.10.2).","short_desc_zh":"","source_rev":"english-manuals:b89cafb3691c3a06583d71c19e7156b968eb5b7de9bd06ba5ba62144d7f12487","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"track_cost_delay_timing","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"track_cost_delay_timing","SourceRevision":"english-manuals:b89cafb3691c3a06583d71c19e7156b968eb5b7de9bd06ba5ba62144d7f12487","Facts":{"boot_val":"off","category":"Statistics / Cumulative Query and Index Statistics","context":"superuser","description":"Enables timing of cost-based vacuum delay (see Section 19.10.2). This parameter is off by default, as it will repeatedly query the operating system for the current time, which may cause significant overhead on some platforms. You can use the pg_test_timing tool to measure the overhead of timing on your system. Cost-based vacuum delay timing information is displayed in pg_stat_progress_vacuum, pg_stat_progress_analyze, in the output of VACUUM and ANALYZE when the VERBOSE option is used, and by autovacuum for auto-vacuums and auto-analyzes when log_autovacuum_min_duration is set. Only superusers and users with the appropriate SET privilege can change this setting.","doc":{"anchor":"GUC-TRACK-COST-DELAY-TIMING","file":"runtime-config-statistics.html","lang":"en","sha256":"90db46d4b011d54f415934fcc658b0841d07af25ae591483c2139ba0e114ed21","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"track_cost_delay_timing","short_desc":"Collects timing statistics for cost-based vacuum delay.","source":"pg-settings-source-snapshot","unit":null,"vartype":"bool"},"ManualEvidence":{"doc":{"anchor":"GUC-TRACK-COST-DELAY-TIMING","file":"runtime-config-statistics.html","lang":"en","sha256":"90db46d4b011d54f415934fcc658b0841d07af25ae591483c2139ba0e114ed21","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"track_cost_delay_timing","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"track_cost_delay_timing","Summary":"","BodyHTML":"\u003cp\u003e启用基于代价的清理延迟计时（参见\u003ca href=\"/docs/18/runtime-config-vacuum.html#RUNTIME-CONFIG-RESOURCE-VACUUM-COST\" rel=\"nofollow\"\u003e第 19.10.2 节\u003c/a\u003e）。默认情况下该参数关闭，因为它需要反复查询操作系统当前时间，在某些平台上可能带来显著开销。你可以使用\u003ca href=\"/docs/18/pgtesttiming.html\" title=\"pg_test_timing\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epg_test_timing\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e工具来衡量系统上的计时开销。基于代价的清理延迟计时信息会显示在\u003ca href=\"/docs/18/progress-reporting.html#VACUUM-PROGRESS-REPORTING\" rel=\"nofollow\"\u003e\u003ccode\u003epg_stat_progress_vacuum\u003c/code\u003e\u003c/a\u003e、\u003ca href=\"/docs/18/progress-reporting.html#ANALYZE-PROGRESS-REPORTING\" rel=\"nofollow\"\u003e\u003ccode\u003epg_stat_progress_analyze\u003c/code\u003e\u003c/a\u003e中，也会显示在带有\u003ccode\u003eVERBOSE\u003c/code\u003e选项的\u003ca href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\" rel=\"nofollow\"\u003e\u003cspan\u003eVACUUM\u003c/span\u003e\u003c/a\u003e和\u003ca href=\"/docs/18/sql-analyze.html\" title=\"ANALYZE\" rel=\"nofollow\"\u003e\u003cspan\u003eANALYZE\u003c/span\u003e\u003c/a\u003e输出中，并且当设置了\u003ca href=\"/docs/18/runtime-config-logging.html#GUC-LOG-AUTOVACUUM-MIN-DURATION\" rel=\"nofollow\"\u003elog_autovacuum_min_duration\u003c/a\u003e时，自动清理进程还会为自动清理和自动分析记录这些信息。只有超级用户和具有适当\u003ccode\u003eSET\u003c/code\u003e权限的用户才能更改此设置。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"f8ef838020ba5f4dfa762cac86e716335c1ca5e3e50da34cfc5e6e00ef57cf01","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e启用基于代价的清理延迟计时（参见\u003ca href=\"/docs/18/runtime-config-vacuum.html#RUNTIME-CONFIG-RESOURCE-VACUUM-COST\" title=\"19.10.2. 基于代价的清理延迟\"\u003e第 19.10.2 节\u003c/a\u003e）。默认情况下该参数关闭，因为它需要反复查询操作系统当前时间，在某些平台上可能带来显著开销。你可以使用\u003ca href=\"/docs/18/pgtesttiming.html\" title=\"pg_test_timing\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_test_timing\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e工具来衡量系统上的计时开销。基于代价的清理延迟计时信息会显示在\u003ca href=\"/docs/18/progress-reporting.html#VACUUM-PROGRESS-REPORTING\" title=\"27.4.5. VACUUM 进度报告\"\u003e\u003ccode class=\"structname\"\u003epg_stat_progress_vacuum\u003c/code\u003e\u003c/a\u003e、\u003ca href=\"/docs/18/progress-reporting.html#ANALYZE-PROGRESS-REPORTING\" title=\"27.4.1. ANALYZE 进度报告\"\u003e\u003ccode class=\"structname\"\u003epg_stat_progress_analyze\u003c/code\u003e\u003c/a\u003e中，也会显示在带有\u003ccode class=\"literal\"\u003eVERBOSE\u003c/code\u003e选项的\u003ca href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\"\u003e\u003cspan class=\"refentrytitle\"\u003eVACUUM\u003c/span\u003e\u003c/a\u003e和\u003ca href=\"/docs/18/sql-analyze.html\" title=\"ANALYZE\"\u003e\u003cspan class=\"refentrytitle\"\u003eANALYZE\u003c/span\u003e\u003c/a\u003e输出中，并且当设置了\u003ca href=\"/docs/18/runtime-config-logging.html#GUC-LOG-AUTOVACUUM-MIN-DURATION\"\u003elog_autovacuum_min_duration\u003c/a\u003e时，自动清理进程还会为自动清理和自动分析记录这些信息。只有超级用户和具有适当\u003ccode class=\"literal\"\u003eSET\u003c/code\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}
