WAL statistics#
What it does
Shows cumulative write-ahead log generation and write statistics.
Use when
- Investigating WAL volume, write pressure, or replication bandwidth.
- Comparing WAL generation between observations.
Inspect
- Rapid growth in WAL bytes or full WAL buffer events.
- The statistics reset time before interpreting cumulative values.
Result
Cumulative statistics since PostgreSQL last reset the relevant counters.
Columns#
| Column | Meaning |
|---|---|
stats_reset |
Time at which WAL statistics were last reset. |
wal_buffer_full_events |
Times WAL data had to be written because WAL buffers were full. |
wal_bytes |
Total bytes of WAL generated. |
wal_bytes_pretty |
Human-readable total WAL generated. |
wal_full_page_images |
Full-page images written to WAL. |
wal_records |
WAL records generated. |
wal_sync_time_ms |
Time spent synchronizing WAL files through PostgreSQL 17; null on PostgreSQL 18. |
wal_syncs |
WAL file synchronization operations through PostgreSQL 17; null on PostgreSQL 18. |
wal_write_time_ms |
Time spent writing WAL files through PostgreSQL 17; null on PostgreSQL 18. |
wal_writes |
WAL file write operations through PostgreSQL 17; null on PostgreSQL 18. |
Compatibility#
- PostgreSQL 14+
Related checks#
- WAL archiver statistics
wal.archiver