SELECT `performance_schema` . `events_statements_summary_by_digest` . `DIGEST_TEXT` AS `query` , `performance_schema` . `events_statements_summary_by_digest` . `SCHEMA_NAME` AS `db` , IF ( ( ( `performance_schema` . `events_statements_summary_by_digest` . `SUM_NO_GOOD_INDEX_USED` > ? ) OR ( `performance_schema` . `events_statements_summary_by_digest` . `SUM_NO_INDEX_USED` > ? ) ) , ?, ... ) AS `full_scan` , `performance_schema` . `events_statements_summary_by_digest` . `COUNT_STAR` AS `exec_count` , `performance_schema` . `events_statements_summary_by_digest` . `SUM_ERRORS` AS `err_count` , `performance_schema` . `events_statements_summary_by_digest` . `SUM_WARNINGS` AS `warn_count` , `performance_schema` . `events_statements_summary_by_digest` . `SUM_TIMER_WAIT` AS `total_latency` , `performance_schema` . `events_statements_summary_by_digest` . `MAX_TIMER_WAIT` AS `max_latency` , `performance_schema` . `events_statements_summary_by_digest` . `AVG_TIMER_WAIT` AS `avg_latency` , 