get_per_backend_io_stats
Analyze per-backend I/O and WAL statistics to identify PostgreSQL processes causing high I/O activity and diagnose process-level hotspots (PG 18+).
Instructions
[Tool Purpose]: Analyze per-backend I/O and WAL statistics (PostgreSQL 18+)
Note: Uses pg_stat_get_backend_io() and pg_stat_get_backend_wal() which are new in PG 18.
[Exact Functionality]:
Show I/O statistics broken down by individual backend process
Display per-backend WAL generation statistics
Identify backends with highest I/O activity
Falls back to version notice on PG < 18
[Required Use Cases]:
When user requests "per-backend I/O", "backend I/O stats", "which backend is doing most I/O"
When diagnosing I/O hotspots at the process level
When analyzing per-connection I/O patterns
[Strictly Prohibited Use Cases]:
Requests for backend termination
Requests for I/O configuration changes
Args: database_name: Database name (uses default if omitted) limit: Maximum results (1-100, default 20)
Returns: Per-backend I/O and WAL statistics, or version notice on older PG
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| database_name | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |