SELECT `sys` . `format_statement` ( `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` , `sys` . `format_time` ( `performance_schema` . `events_statements_summary_by_digest` . `SUM_TIMER_WAIT` ) AS `total_latency` , `performance_schema` . `events_statements_summary_by_digest` . `SUM_CREATED_TMP_TABLES` AS `memory_tmp_tables` , `performance_schema` . `events_statements_summary_by_digest` . `SUM_CREATED_TMP_DISK_TABLES` AS `disk_tmp_tables` , `round` ( `ifnull` ( ( `performance_schema` . `events_statements_summary_by_digest` . `SUM_CREATED_TMP_TABLES` / `nullif` ( `performance_schema` . `events_statements_summary_by_digest` . `COUNT_STAR` , ? ) ) , ? ) , ? ) AS `avg_tmp_tables_per_query` , `round` ( ( `ifnull` ( ( `performance_schema` . 