DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Statistics / Cumulative Query and Index Statistics

track_wal_io_timing

Collects timing statistics for WAL I/O activity.

  • Default: off
  • Type: bool
  • Applies: Session (superuser)

In plain words

Commits wait for WAL to be written and flushed to disk. With this on, PostgreSQL times those WAL writes and fsyncs, so you can see whether slow WAL storage is holding back your commits.

For DBAs and operators

In PostgreSQL 18 WAL I/O statistics moved to pg_stat_io: rows with object = 'wal' (contexts normal for writes/fsyncs and init for creating new segments) carry writes, write_bytes, fsyncs and, with this setting on, write_time and fsync_time. The old pg_stat_wal columns wal_write, wal_sync, wal_write_time and wal_sync_time were removed in 18; pg_stat_wal now only has wal_records, wal_fpi, wal_bytes, wal_buffers_full. Monitoring queries written for 14–17 need updating.

SELECT backend_type, context, writes, write_time, fsyncs, fsync_time
  FROM pg_stat_io WHERE object = 'wal';

WAL reads (by walsenders, recovery) are also recorded there. fsync_time / fsyncs is a good estimate of commit latency caused by storage; compare it with pg_test_fsync. Same clock-overhead caveat as track_io_timing (check pg_test_timing).

How to change it

A superuser (or a role granted SET) can change it per session with SET.

See it in context

Cumulative statistics Write-ahead log (WAL) WAL writer

Related parameters

track_io_timing wal_sync_method synchronous_commit commit_delay

All Statistics parameters