top_queries
Retrieve ranked MySQL/MariaDB statement digests from performance_schema by metrics like total_time, mean_time, or calls to spot slow or high-load queries.
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 |