SELECT IF ( `isnull` ( `performance_schema` . `events_waits_summary_by_user_by_event_name` . `USER` ) , ? , `performance_schema` . `events_waits_summary_by_user_by_event_name` . `USER` ) AS `user` , `performance_schema` . `events_waits_summary_by_user_by_event_name` . `EVENT_NAME` AS `event_name` , `performance_schema` . `events_waits_summary_by_user_by_event_name` . `COUNT_STAR` AS `total` , `sys` . `format_time` ( `performance_schema` . `events_waits_summary_by_user_by_event_name` . `SUM_TIMER_WAIT` ) AS `latency` , `sys` . `format_time` ( `performance_schema` . `events_waits_summary_by_user_by_event_name` . `MAX_TIMER_WAIT` ) AS `max_latency` FROM `performance_schema` . `events_waits_summary_by_user_by_event_name` WHERE ( ( `performance_schema` . `events_waits_summary_by_user_by_event_name` . `EVENT_NAME` LIKE ? ) AND ( `performance_schema` . `events_waits_summary_by_user_by_event_name` . `COUNT_STAR` > ? ) ) ORDER BY IF ( `isnull` ( `performance_schema` . 