1818 *
1919 * Summarizes file IO by event type per host.
2020 *
21+ * When the host found is NULL, it is assumed to be a "background" thread.
2122 *
2223 * mysql> select * from host_summary_by_file_io_type;
23- * +------------+--------------------------------------+-------+-----------+-------------+
24- * | host | event_name | total | latency | max_latency |
25- * +------------+--------------------------------------+-------+-----------+-------------+
26- * | hal1 | wait/io/file/sql/FRM | 871 | 168.15 ms | 18.48 ms |
27- * | hal1 | wait/io/file/innodb/innodb_data_file | 173 | 129.56 ms | 34.09 ms |
28- * | hal1 | wait/io/file/innodb/innodb_log_file | 20 | 77.53 ms | 60.66 ms |
29- * | hal1 | wait/io/file/myisam/dfile | 40 | 6.54 ms | 4.58 ms |
30- * | hal1 | wait/io/file/mysys/charset | 3 | 4.79 ms | 4.71 ms |
31- * | hal1 | wait/io/file/myisam/kfile | 67 | 4.38 ms | 300.04 us |
32- * | hal1 | wait/io/file/sql/ERRMSG | 5 | 2.72 ms | 1.69 ms |
33- * | hal1 | wait/io/file/sql/pid | 3 | 266.30 us | 185.47 us |
34- * | hal1 | wait/io/file/sql/casetest | 5 | 246.81 us | 150.19 us |
35- * | hal1 | wait/io/file/sql/global_ddl_log | 2 | 21.24 us | 18.59 us |
36- * | hal2 | wait/io/file/sql/file_parser | 1422 | 4.80 s | 135.14 ms |
37- * | hal2 | wait/io/file/sql/FRM | 865 | 85.82 ms | 9.81 ms |
38- * | hal2 | wait/io/file/myisam/kfile | 1073 | 37.14 ms | 15.79 ms |
39- * | hal2 | wait/io/file/myisam/dfile | 2991 | 25.53 ms | 5.25 ms |
40- * | hal2 | wait/io/file/sql/dbopt | 20 | 1.07 ms | 153.07 us |
41- * | hal2 | wait/io/file/sql/misc | 4 | 59.71 us | 33.75 us |
42- * | hal2 | wait/io/file/archive/data | 1 | 13.91 us | 13.91 us |
43- * +------------+--------------------------------------+-------+-----------+-------------+
24+ * +------------+--------------------------------------+-------+--------------- +-------------+
25+ * | host | event_name | total | total_latency | max_latency |
26+ * +------------+--------------------------------------+-------+--------------- +-------------+
27+ * | hal1 | wait/io/file/sql/FRM | 871 | 168.15 ms | 18.48 ms |
28+ * | hal1 | wait/io/file/innodb/innodb_data_file | 173 | 129.56 ms | 34.09 ms |
29+ * | hal1 | wait/io/file/innodb/innodb_log_file | 20 | 77.53 ms | 60.66 ms |
30+ * | hal1 | wait/io/file/myisam/dfile | 40 | 6.54 ms | 4.58 ms |
31+ * | hal1 | wait/io/file/mysys/charset | 3 | 4.79 ms | 4.71 ms |
32+ * | hal1 | wait/io/file/myisam/kfile | 67 | 4.38 ms | 300.04 us |
33+ * | hal1 | wait/io/file/sql/ERRMSG | 5 | 2.72 ms | 1.69 ms |
34+ * | hal1 | wait/io/file/sql/pid | 3 | 266.30 us | 185.47 us |
35+ * | hal1 | wait/io/file/sql/casetest | 5 | 246.81 us | 150.19 us |
36+ * | hal1 | wait/io/file/sql/global_ddl_log | 2 | 21.24 us | 18.59 us |
37+ * | hal2 | wait/io/file/sql/file_parser | 1422 | 4.80 s | 135.14 ms |
38+ * | hal2 | wait/io/file/sql/FRM | 865 | 85.82 ms | 9.81 ms |
39+ * | hal2 | wait/io/file/myisam/kfile | 1073 | 37.14 ms | 15.79 ms |
40+ * | hal2 | wait/io/file/myisam/dfile | 2991 | 25.53 ms | 5.25 ms |
41+ * | hal2 | wait/io/file/sql/dbopt | 20 | 1.07 ms | 153.07 us |
42+ * | hal2 | wait/io/file/sql/misc | 4 | 59.71 us | 33.75 us |
43+ * | hal2 | wait/io/file/archive/data | 1 | 13.91 us | 13.91 us |
44+ * +------------+--------------------------------------+-------+--------------- +-------------+
4445 *
4546 */
4647
@@ -52,28 +53,29 @@ VIEW host_summary_by_file_io_type (
5253 host,
5354 event_name,
5455 total,
55- latency ,
56+ total_latency ,
5657 max_latency
5758) AS
58- SELECT host AS host,
59+ SELECT IF( host IS NULL , ' background ' , host) AS host,
5960 event_name,
6061 count_star AS total,
61- sys .format_time (sum_timer_wait) AS latency ,
62+ sys .format_time (sum_timer_wait) AS total_latency ,
6263 sys .format_time (max_timer_wait) AS max_latency
6364 FROM performance_schema .events_waits_summary_by_host_by_event_name
6465 WHERE event_name LIKE ' wait/io/file%'
6566 AND count_star > 0
66- ORDER BY host, sum_timer_wait DESC ;
67+ ORDER BY IF( host IS NULL , ' background ' , host) , sum_timer_wait DESC ;
6768
6869/*
6970 * View: x$host_summary_by_file_io_type
7071 *
7172 * Summarizes file IO by event type per host.
7273 *
74+ * When the host found is NULL, it is assumed to be a "background" thread.
7375 *
7476 * mysql> select * from x$host_summary_by_file_io_type;
7577 * +------------+--------------------------------------+-------+---------------+--------------+
76- * | host | event_name | total | latency | max_latency |
78+ * | host | event_name | total | total_latency | max_latency |
7779 * +------------+--------------------------------------+-------+---------------+--------------+
7880 * | hal1 | wait/io/file/sql/FRM | 871 | 168148450470 | 18482624810 |
7981 * | hal1 | wait/io/file/innodb/innodb_data_file | 173 | 129564287450 | 34087423890 |
@@ -104,15 +106,15 @@ VIEW x$host_summary_by_file_io_type (
104106 host,
105107 event_name,
106108 total,
107- latency ,
109+ total_latency ,
108110 max_latency
109111) AS
110- SELECT host AS host,
112+ SELECT IF( host IS NULL , ' background ' , host) AS host,
111113 event_name,
112114 count_star AS total,
113- sum_timer_wait AS latency ,
115+ sum_timer_wait AS total_latency ,
114116 max_timer_wait AS max_latency
115117 FROM performance_schema .events_waits_summary_by_host_by_event_name
116118 WHERE event_name LIKE ' wait/io/file%'
117119 AND count_star > 0
118- ORDER BY host, sum_timer_wait DESC ;
120+ ORDER BY IF( host IS NULL , ' background ' , host) , sum_timer_wait DESC ;
0 commit comments