Statement analysis

This output is similar to the output of  performance_schema.events_statements_summary_by_digest and pt-query-digest.

The top query by execution count is as follows:

mysql> SELECT * FROM sys.statement_analysis ORDER BY exec_count DESC LIMIT 1\G*************************** 1. row ***************************            query: SELECT `e` . `emp_no` , `salar ... emp_no` WHERE `from_date` = ?                db: employees        full_scan:        exec_count: 159997        err_count: 0       warn_count: 0    total_latency: 1.98 h      max_latency: 661.58 ms      avg_latency: 44.54 ms     lock_latency: 1.28 m        rows_sent: 14400270    rows_sent_avg: 90    rows_examined: 28800540rows_examined_avg: 180    rows_affected: 0rows_affected_avg: 0       tmp_tables: 0  tmp_disk_tables: 0      rows_sorted: 0sort_merge_passes: 0

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.