OVER (ORDER BY SUM_TIMER_WAIT DESC) AS No, COUNT_STAR AS calls, ROUND(SUM_TIMER_WAIT/1000000000, 2) AS sum, ROUND((SUM_TIMER_WAIT / (SELECT SUM(SUM_TIMER_WAIT) FROM performance_schema.events_statements_summary_by_digest))*100, 2) AS "%", ROUND(SUM_TIMER_WAIT/1000000000 / COUNT_STAR, 2) AS "R/C", ROUND(MAX_TIMER_WAIT/1000000000, 2) AS max_t, ROUND(MIN_TIMER_WAIT/1000000000, 2) AS min_t, ROUND(MAX_TOTAL_MEMORY/1024, 0) AS memKb, SUM_NO_INDEX_USED noIndex, SUM_NO_GOOD_INDEX_USED badIndex,DIGEST_TEXT AS query_pattern FROM performance_schema.events_statements_summary_by_digest WHERE SCHEMA_NAME IS NOT NULL ORDER BY sum DESC;