top_queries
Identify slow or resource-intensive SQL by retrieving top statement digests from MySQL performance_schema, ordered by time, calls, rows examined, lock time, or no-index scans, to pinpoint optimization targets.
Instructions
[READ] Top statement digests from performance_schema by a whitelisted metric.
Args: order_by: One of total_time, mean_time, calls, rows_examined, lock_time, no_index. limit: Number of statements to return (1..200, default 20). target: Target name from config; omit for the default.
Returns an envelope: {"statements": [...], "returned": N, "limit": L, "truncated": bool}. When "truncated" is true there is more beyond what was returned — re-run with a higher limit rather than treating this as the complete picture.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| target | No | ||
| order_by | No | total_time |