Monitoring InnoDB Mutex Waits Using Performance Schema | events_stages_history | NO | | events_stages_history_long | NO | | events_statements_current | YES | | events_statements_history | YES | | events_statements_history_long | NO | | events_transactions_current | YES | | events_transactions_history | YES | | events_transactions_history_long | NO | | events_waits_current | YES | | events_waits_history | YES | | events_waits_history_long | YES | | global_instrumentation | YES | | thread_instrumentation | YES | | statements_digest | YES | +----------------------------------+---------+ 15 rows in set (0.00 sec) 4. Once instruments and consumers are enabled, run the workload that you want to monitor. In this example, the  mysqlslap  load emulation client is used to simulate a workload. 5. Query the wait event data. In this example, wait event data is queried from the events_waits_summary_global_by_event_name  table which aggregates data found in the events_waits_current ,  events_waits_history , and  events_waits_history_long  tables. Data is summarized by event name ( EVENT_NAME ), which is the name of the instrument that produced the event. Summarized data includes: • COUNT_STAR • SUM_TIMER_WAIT • MIN_TIMER_WAIT • AVG_TIMER_WAIT • MAX_TIMER_WAIT shell>  ./mysqlslap --auto-generate-sql --concurrency=100 --iterations=10  --number-of-queries=1000 --number-char-cols=6 --number-int-cols=6; The number of summarized wait events. The total wait time of the summarized timed wait events. The minimum wait time of the summarized timed wait events. The average wait time of the summarized timed wait events. The maximum wait time of the summarized timed wait events. The following query returns the instrument name ( EVENT_NAME ), the number of wait events ( COUNT_STAR ), and the total wait time for the events for that instrument ( SUM_TIMER_WAIT ). Because waits are timed in picoseconds (trillionths of a second) by default, wait times are divided by 1000000000 to show wait times in milliseconds. Data is presented in descending order, by the number of summarized wait events ( COUNT_STAR ). You can adjust the  ORDER BY  clause to order the data by total wait time. mysql>  SELECT EVENT_NAME, COUNT_STAR, SUM_TIMER_WAIT/1000000000 SUM_TIMER_WAIT_MS FROM performance_schema.events_waits_summary_global_by_event_name WHERE SUM_TIMER_WAIT > 0 AND EVENT_NAME LIKE ’wait/synch/mutex/innodb/%’ ORDER BY COUNT_STAR DESC; +---------------------------------------------------------+------------+-------------------+ 3338