analyze_slow_queries
Identifies and analyzes slow database queries, showing execution times and optimization recommendations. Works with PostgreSQL and MySQL.
Instructions
Find the slowest queries using pg_stat_statements (PostgreSQL) or performance_schema (MySQL). Shows execution times, call counts, and optimization recommendations. PostgreSQL requires the pg_stat_statements extension to be installed and listed in shared_preload_libraries — the tool returns setup instructions if the extension is missing. Not available for SQLite.
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": "analyze_slow_queries"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | Database schema (default: public) | public |
| limit | No | Number of slow queries to return (default: 10) | |
| timeout_ms | No | Connection timeout in milliseconds (default: 30000). Increase for slow or remote databases. |