Read PG stat IO
read_pg_stat_ioDiagnose write amplification and buffer-cache misses via cumulative I/O stats (reads, writes, hits, etc.) per backend type, object, and context. Works on PostgreSQL 16+.
Instructions
Read the pg_stat_io view (PostgreSQL 16+). Reports per (backend_type, object, context) cumulative I/O activity — reads, writes, extends, evictions, hits, fsyncs. Useful for spotting buffer-cache misses and write amplification. On PostgreSQL 14 / 15 the view doesn't exist, so the tool returns available=false and an empty list.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | ||
| available | Yes | ||
| server_version | Yes |