WAL and checkpoints
pg_wal_checkpointsDiagnose scheduled versus forced checkpoint and WAL activity to explain write-heavy I/O spikes and archiving issues, and identify tuning actions like raising max_wal_size.
Instructions
Explain how checkpoints and WAL behave: scheduled versus forced checkpoints and the buffers they wrote (pg_stat_bgwriter up to PostgreSQL 16, pg_stat_checkpointer from 17), WAL volume (pg_stat_wal, 14+), the archiver (pg_stat_archiver), the current WAL position and the WAL-related settings, ending with a one-line reading such as "forced checkpoints: raise max_wal_size".
Use it for write-heavy servers, I/O spikes every few minutes and archiving problems. Counters accumulate since the statistics reset.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "pg_wal_checkpoints"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection | No |