analyze_statements
Analyze SQL statement performance from MySQL's performance schema to identify slow queries, execution patterns, and optimization opportunities for database tuning.
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.
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 |