{"Entry":{"collection":"guc","key":"track_io_timing","name":"track_io_timing","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Statistics / Cumulative Query and Index Statistics","category_zh":"","changed_in":["15"],"changes":[{"documentation_changed":false,"fields":{},"from":"9.1","status":"added","to":"9.2"},{"documentation_changed":true,"fields":{},"from":"13","status":"changed","to":"14"},{"documentation_changed":true,"fields":{"category":{"from":"Statistics / Query and Index Statistics Collector","to":"Statistics / Cumulative Query and Index Statistics"}},"from":"14","status":"changed","to":"15"},{"documentation_changed":true,"fields":{},"from":"15","status":"changed","to":"16"},{"documentation_changed":true,"fields":{},"from":"17","status":"changed","to":"18"}],"content_hash":"ac3b790989f8e0bdeeb24584dcba9be349de0cb09d698d74be3c5cfab7e19a63","context":"","default_changed_in":[],"default_history":[{"from":"9.2","to":"19","value":"off"}],"editorial":{"advice":{"olap":"Long scans and spills make relation and temporary-file timing valuable. Keep it on when those counters drive diagnosis, but compare execution overhead and distinguish elapsed waits from device-only service time.","oltp":"Enable it when database I/O wait time is needed for pg_stat_io, EXPLAIN with BUFFERS, or incident analysis. Measure clock-read overhead with pg_test_timing and at peak statement rates;","small":"Use on only when the platform's clock-read cost is acceptable and the measurements are consumed. The boolean has no conservative numeric size; off removes timing but does not remove I/O itself."},"mechanism":["track_io_timing measures database I/O wait time outside the WAL object. It populates pg_stat_database, pg_stat_io, pg_stat_get_backend_io(), EXPLAIN with BUFFERS, maintenance output, and supporting extensions.","The setting repeatedly reads the operating-system clock; overhead is platform dependent and measurable with pg_test_timing. It records elapsed wait, not device service time in isolation.","WAL I/O timing is controlled separately by track_wal_io_timing. Enabling timing adds observability but does not make I/O asynchronous or change planner costs. Its superuser context permits an authorized session change without a server restart."],"pitfalls":["Treating measured wait time as isolated device service time without queueing or scheduling effects.","Expecting the switch to make I/O asynchronous or change planner cost estimates.","Assuming it includes WAL timing, which is controlled by track_wal_io_timing.","Enabling it without measuring clock-read overhead on the actual platform."],"references":[{"title":"PostgreSQL 19 Beta 4: track_io_timing","url":"https://www.postgresql.org/docs/19/runtime-config-statistics.html#GUC-TRACK-IO-TIMING"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["track_wal_io_timing","track_counts","stats_fetch_consistency","effective_io_concurrency","compute_query_id"],"summary":"track_io_timing — Collects timing statistics for database I/O activity. Observed in PG9.2–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":"9.2","group":"Statistics","group_slug":"statistics","imported_at":"2026-09-27T17:57:32.220454+08:00","intro_commit":{"authored_at":"2012-04-29T16:23:54-04:00","discussion":[],"hash":"309c64745ea145d7c731e1fe610631b2b84e7e88","subject":"Rename track_iotiming GUC to track_io_timing.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=309c64745ea145d7c731e1fe610631b2b84e7e88"},"key":"track_io_timing","last_version":"20","max_val":"","min_val":"","name":"track_io_timing","position":431,"present_in":["9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"short_desc":"Enables timing of database I/O waits.","short_desc_zh":"","source_rev":"english-manuals:fbdd65c16e766c5336f29d0a8f63660cd35f1ba9e64de1644b4d090f3b17f3c6","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"track_io_timing","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"track_io_timing","SourceRevision":"english-manuals:fbdd65c16e766c5336f29d0a8f63660cd35f1ba9e64de1644b4d090f3b17f3c6","Facts":{"boot_val":"off","category":"Statistics / Cumulative Query and Index Statistics","context":"superuser","description":"Enables timing of database I/O waits. 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. I/O timing information is displayed in pg_stat_database, pg_stat_io (if object is not wal), in the output of the pg_stat_get_backend_io() function (if object is not wal), in the output of EXPLAIN when the BUFFERS option is used, in the output of VACUUM when the VERBOSE option is used, by autovacuum for auto-vacuums and auto-analyzes, when log_autovacuum_min_duration is set and by pg_stat_statements. Only superusers and users with the appropriate SET privilege can change this setting.","doc":{"anchor":"GUC-TRACK-IO-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_io_timing","short_desc":"Collects timing statistics for database I/O activity.","source":"pg-settings-source-snapshot","unit":null,"vartype":"bool"},"ManualEvidence":{"doc":{"anchor":"GUC-TRACK-IO-TIMING","file":"runtime-config-statistics.html","lang":"en","sha256":"90db46d4b011d54f415934fcc658b0841d07af25ae591483c2139ba0e114ed21","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"track_io_timing","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"track_io_timing","Summary":"","BodyHTML":"\u003cp\u003e启用数据库 I/O 等待的计时。此参数默认关闭，因为计时需要反复向操作系统查询当前时间，在某些平台上可能会产生显著开销。可以使用\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工具测量本系统上的计时开销。I/O 计时信息会显示在 \u003ca href=\"/docs/18/monitoring-stats.html#MONITORING-PG-STAT-DATABASE-VIEW\" rel=\"nofollow\"\u003e\u003ccode\u003epg_stat_database\u003c/code\u003e\u003c/a\u003e 中、\u003ca href=\"/docs/18/monitoring-stats.html#MONITORING-PG-STAT-IO-VIEW\" rel=\"nofollow\"\u003e\u003ccode\u003epg_stat_io\u003c/code\u003e\u003c/a\u003e 中（当 \u003ccode\u003eobject\u003c/code\u003e 不是 \u003ccode\u003ewal\u003c/code\u003e 时）、\u003ca href=\"/docs/18/monitoring-stats.html#PG-STAT-GET-BACKEND-IO\" rel=\"nofollow\"\u003e\u003ccode\u003epg_stat_get_backend_io()\u003c/code\u003e\u003c/a\u003e 函数的输出中（当 \u003ccode\u003eobject\u003c/code\u003e 不是 \u003ccode\u003ewal\u003c/code\u003e 时）、使用 \u003ccode\u003eBUFFERS\u003c/code\u003e 选项的\u003ca href=\"/docs/18/sql-explain.html\" title=\"EXPLAIN\" rel=\"nofollow\"\u003e\u003cspan\u003eEXPLAIN\u003c/span\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/runtime-config-logging.html#GUC-LOG-AUTOVACUUM-MIN-DURATION\" rel=\"nofollow\"\u003elog_autovacuum_min_duration\u003c/a\u003e），\u003ca href=\"/docs/18/pgstatstatements.html\" rel=\"nofollow\"\u003epg_stat_statements\u003c/a\u003e同样提供这些信息。只有超级用户和具有适当 \u003ccode\u003eSET\u003c/code\u003e 权限的用户可以更改此设置。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"0638ac7c413575c9b078c8fad07fc280470fb376481dcaf6343a162a3be9b12d","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e启用数据库 I/O 等待的计时。此参数默认关闭，因为计时需要反复向操作系统查询当前时间，在某些平台上可能会产生显著开销。可以使用\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工具测量本系统上的计时开销。I/O 计时信息会显示在 \u003ca href=\"/docs/18/monitoring-stats.html#MONITORING-PG-STAT-DATABASE-VIEW\" title=\"27.2.17. pg_stat_database\"\u003e\u003ccode class=\"structname\"\u003epg_stat_database\u003c/code\u003e\u003c/a\u003e 中、\u003ca href=\"/docs/18/monitoring-stats.html#MONITORING-PG-STAT-IO-VIEW\" title=\"27.2.13. pg_stat_io\"\u003e\u003ccode class=\"structname\"\u003epg_stat_io\u003c/code\u003e\u003c/a\u003e 中（当 \u003ccode class=\"varname\"\u003eobject\u003c/code\u003e 不是 \u003ccode class=\"literal\"\u003ewal\u003c/code\u003e 时）、\u003ca href=\"/docs/18/monitoring-stats.html#PG-STAT-GET-BACKEND-IO\"\u003e\u003ccode class=\"function\"\u003epg_stat_get_backend_io()\u003c/code\u003e\u003c/a\u003e 函数的输出中（当 \u003ccode class=\"varname\"\u003eobject\u003c/code\u003e 不是 \u003ccode class=\"literal\"\u003ewal\u003c/code\u003e 时）、使用 \u003ccode class=\"literal\"\u003eBUFFERS\u003c/code\u003e 选项的\u003ca href=\"/docs/18/sql-explain.html\" title=\"EXPLAIN\"\u003e\u003cspan class=\"refentrytitle\"\u003eEXPLAIN\u003c/span\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/runtime-config-logging.html#GUC-LOG-AUTOVACUUM-MIN-DURATION\"\u003elog_autovacuum_min_duration\u003c/a\u003e），\u003ca href=\"/docs/18/pgstatstatements.html\" title=\"F.32. pg_stat_statements — 跟踪 SQL 计划和执行统计信息\"\u003epg_stat_statements\u003c/a\u003e同样提供这些信息。只有超级用户和具有适当 \u003ccode class=\"literal\"\u003eSET\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","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
