SELECT `performance_schema` . `events_statements_summary_by_digest` . `DIGEST_TEXT` AS `query` , `performance_schema` . `events_statements_summary_by_digest` . `SCHEMA_NAME` AS `db` , `performance_schema` . `events_statements_summary_by_digest` . `COUNT_STAR` AS `exec_count` , `performance_schema` . `events_statements_summary_by_digest` . `SUM_ERRORS` AS `errors` , ( `ifnull` ( ( `performance_schema` . `events_statements_summary_by_digest` . `SUM_ERRORS` / `nullif` ( `performance_schema` . `events_statements_summary_by_digest` . `COUNT_STAR` , ? ) ) , ? ) * ? ) AS `error_pct` , `performance_schema` . `events_statements_summary_by_digest` . `SUM_WARNINGS` AS `warnings` , ( `ifnull` ( ( `performance_schema` . `events_statements_summary_by_digest` . `SUM_WARNINGS` / `nullif` ( `performance_schema` . `events_statements_summary_by_digest` . `COUNT_STAR` , ? ) ) , ? ) * ? ) AS `warning_pct` , `performance_schema` . `events_statements_summary_by_digest` . `FIRST_SEEN` AS `first_seen` , 