get_top_queries
Identify and rank a PostgreSQL database's slowest or most resource-intensive queries via pg_stat_statements data, enabling targeted performance tuning and index planning.
Instructions
Reports the slowest or most resource-intensive queries using data from the 'pg_stat_statements' extension. Only statements of the current database are reported.
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 |
|---|---|---|---|
| limit | No | Number of queries to return | |
| sort_by | No | Ranking criteria: 'total_time' for total execution time or 'mean_time' for mean execution time per call, or 'resources' for resource-intensive queries | resources |