O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required