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.
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. |