Enables timing of WAL I/O waits.
At a glance
| Property | Value |
|---|---|
| Parameter | track_wal_io_timing |
| Category | Run-time Statistics |
| Default | (see documentation) |
| Value type | boolean (on/off) |
| Change scope | Per-session (SET) |
| Available in | PostgreSQL 14, 15, 16, 17, 18, 19 (added in 14) |
What it does
Enables timing of WAL 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_io for the object wal and in the output of the pg_stat_get_backend_io() function for the object wal. Only superusers and users with the appropriate SET privilege can change this setting.
(Description quoted from the official PostgreSQL documentation.)
How to apply a change
Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.
Inspect the current value and source with SHOW track_wal_io_timing; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'track_wal_io_timing';.
Tuning guidance
This governs how much activity and timing data the server collects. Collecting more improves visibility in pg_stat_* views and monitoring but adds a little overhead; collecting less is cheaper but blinds your tooling. Enable the tracking your monitoring actually consumes and leave the rest at default.