Recommend IO method
recommend_io_methodRecommends a PostgreSQL 19 io_method (sync, worker, or io_uring) from workload read/cache stats and returns ready-to-run SQL when a setting change is advised.
Instructions
Recommend a PG 19 io_method ('sync' / 'worker' / 'io_uring') for the current workload. Reads pg_stat_database aggregates (blks_read / blks_hit / stats_reset) and the current setting, then maps the workload signals to one of: high_concurrent_read_load (→ io_uring), bursty_io_with_cache_pressure (→ worker), low_io_pressure (→ sync), current_setting_optimal (no change), or insufficient_stats (window too short). Read-only — never invokes ALTER SYSTEM; emits a ready_to_run_sql snippet the operator can paste when the recommendation differs from the current setting. Returns an object with available (bool), server_version_num, detail, and recommendations — a list of objects with recommended_method, reason, current_method, cache_miss_ratio, reads_per_second, stats_window_seconds, and ready_to_run_sql (null when no change suggested).
Example: recommend_io_method()
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": "recommend_io_method"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | No | Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| detail | Yes | ||
| available | Yes | ||
| recommendations | Yes | ||
| server_version_num | Yes |