analyze_statements
Analyze SQL statement performance metrics including execution times, row efficiency, and error rates to identify optimization opportunities in MySQL databases.
Instructions
Analyze SQL statements from performance_schema/sys schema.
Provides comprehensive analysis of:
Statement digest summaries
Total and average execution times
Rows examined vs rows sent ratios
Statement error rates
Most expensive queries
Based on MySQLTuner's performance schema analysis. Requires performance_schema enabled.
Note: This tool excludes queries against MySQL system schemas (mysql, information_schema, performance_schema, sys) to focus on user/application query analysis.
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_statements"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema_name | No | Filter by specific schema (optional) | |
| order_by | No | Order by metric | total_latency |
| limit | No | Maximum number of statements to return | |
| min_exec_count | No | Minimum execution count filter |