MySQLPerformance
Top statements by total latency
From the sys schema, which already sorts this view by total latency. Needs performance_schema enabled.
Not yet verified. How scripts are tested
1SELECT query, db, exec_count,2 total_latency, avg_latency,3 rows_examined_avg4FROM sys.statement_analysis5LIMIT 20;Paste it into your query tool.