get_top_queries
Identify slow or resource-intensive queries by ranking pg_stat_statements and Multigres gateway statistics separately, helping you target database performance tuning.
Instructions
Report the slowest or most resource-intensive queries from pg_stat_statements and from the query statistics each Multigres gateway keeps. The two sources cover different periods and are shown separately.
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": "get_top_queries"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node | No | Read pg_stat_statements on this node over a direct connection (cell/name, name, or primary); default is through the gateway | |
| limit | No | Number of queries when ranking by total_time or mean_time (default 10) | |
| source | No | both (default), pg_stat_statements, or gateway for the query statistics each Multigres gateway keeps | |
| sort_by | No | Ranking: total_time, mean_time, or resources for queries using more than 5% of any resource (default resources) |