events_waits_summary_by_thread_by_event_name 详解

Posted by 道行尚浅 on September 20, 2021

系统表介绍

events_waits_summary_by_thread_by_event_name 按事件名称与线程ID进行汇总

列名 含义
THREAD_ID 线程编号
EVENT_NAME 事件名称
COUNT_STAR 事件汇总数量
SUM_TIMER_WAIT 事件总等待时间
MIN_TIMER_WAIT 事件最小等待时间
AVG_TIMER_WAIT 事件平均等待时间
MAX_TIMER_WAIT 事件最大等待时间

实例


mysql> SELECT *
    -> FROM events_waits_summary_by_thread_by_event_name
    -> WHERE COUNT_STAR > 0
    -> order by 1   desc 
    -> limit 10 ;
+-----------+---------------------------+------------+------------------+----------------+----------------+------------------+
| THREAD_ID | EVENT_NAME                | COUNT_STAR | SUM_TIMER_WAIT   | MIN_TIMER_WAIT | AVG_TIMER_WAIT | MAX_TIMER_WAIT   |
+-----------+---------------------------+------------+------------------+----------------+----------------+------------------+
|        45 | idle                      |         66 | 1830650615000000 |      156000000 | 27737130000000 | 1721593155000000 |
|        45 | wait/io/file/sql/io_cache |         20 |       1149850125 |        2440125 |       57492375 |        214969125 |
|        43 | idle                      |         10 |       3535000000 |      104000000 |      353000000 |       1058000000 |
|        42 | idle                      |         10 |       3763000000 |      207000000 |      376000000 |        941000000 |
|        41 | wait/io/file/sql/FRM      |        275 |      24937532625 |        1281000 |       90681750 |      21677589375 |
|        41 | wait/io/file/archive/data |          1 |          4288875 |        4288875 |        4288875 |          4288875 |
|        41 | idle                      |        265 | 1834673557000000 |      155000000 |  6923296000000 | 1719031968000000 |
|        41 | wait/io/file/myisam/dfile |        577 |      29086064250 |        1970250 |       50409000 |      11668195500 |
|        41 | wait/io/file/myisam/kfile |          4 |        879372000 |        2177625 |      219843000 |        787072125 |
|        40 | wait/io/file/archive/data |          1 |         23195625 |       23195625 |       23195625 |         23195625 |
+-----------+---------------------------+------------+------------------+----------------+----------------+------------------+
10 rows in set (0.01 sec)