Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit 23397d1

Browse files
committed
Use 'total' more consistently (instead of count_star, etc.)
1 parent a254cf3 commit 23397d1

15 files changed

+535
-488
lines changed

README.md

Lines changed: 135 additions & 135 deletions
Large diffs are not rendered by default.

views/p_s/io_by_thread_by_latency.sql

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@
1919
* Show the top IO consumers by thread, ordered by total latency
2020
*
2121
* mysql> select * from io_by_thread_by_latency;
22-
* +---------------------+------------+---------------+-------------+-------------+-------------+-----------+----------------+
23-
* | user | count_star | total_latency | min_latency | avg_latency | max_latency | thread_id | processlist_id |
24-
* +---------------------+------------+---------------+-------------+-------------+-------------+-----------+----------------+
25-
* | root@localhost | 11580 | 18.01 s | 429.78 ns | 1.12 ms | 181.07 ms | 25 | 6 |
26-
* | main | 1358 | 1.31 s | 475.02 ns | 2.27 ms | 350.70 ms | 1 | NULL |
27-
* | page_cleaner_thread | 654 | 147.44 ms | 588.12 ns | 225.44 us | 46.41 ms | 18 | NULL |
28-
* | io_write_thread | 131 | 107.75 ms | 8.60 us | 822.55 us | 27.69 ms | 8 | NULL |
29-
* | io_write_thread | 46 | 47.07 ms | 10.64 us | 1.02 ms | 16.90 ms | 9 | NULL |
30-
* | io_write_thread | 71 | 46.99 ms | 9.11 us | 661.81 us | 17.04 ms | 11 | NULL |
31-
* | io_log_thread | 20 | 21.01 ms | 14.25 us | 1.05 ms | 7.08 ms | 3 | NULL |
32-
* | srv_master_thread | 13 | 17.60 ms | 8.49 us | 1.35 ms | 9.99 ms | 16 | NULL |
33-
* | srv_purge_thread | 4 | 1.81 ms | 34.31 us | 452.45 us | 1.02 ms | 17 | NULL |
34-
* | io_write_thread | 19 | 951.39 us | 9.75 us | 50.07 us | 297.47 us | 10 | NULL |
35-
* | signal_handler | 3 | 218.03 us | 21.64 us | 72.68 us | 154.84 us | 19 | NULL |
36-
* +---------------------+------------+---------------+-------------+-------------+-------------+-----------+----------------+
22+
* +---------------------+-------+---------------+-------------+-------------+-------------+-----------+----------------+
23+
* | user | total | total_latency | min_latency | avg_latency | max_latency | thread_id | processlist_id |
24+
* +---------------------+-------+---------------+-------------+-------------+-------------+-----------+----------------+
25+
* | root@localhost | 11580 | 18.01 s | 429.78 ns | 1.12 ms | 181.07 ms | 25 | 6 |
26+
* | main | 1358 | 1.31 s | 475.02 ns | 2.27 ms | 350.70 ms | 1 | NULL |
27+
* | page_cleaner_thread | 654 | 147.44 ms | 588.12 ns | 225.44 us | 46.41 ms | 18 | NULL |
28+
* | io_write_thread | 131 | 107.75 ms | 8.60 us | 822.55 us | 27.69 ms | 8 | NULL |
29+
* | io_write_thread | 46 | 47.07 ms | 10.64 us | 1.02 ms | 16.90 ms | 9 | NULL |
30+
* | io_write_thread | 71 | 46.99 ms | 9.11 us | 661.81 us | 17.04 ms | 11 | NULL |
31+
* | io_log_thread | 20 | 21.01 ms | 14.25 us | 1.05 ms | 7.08 ms | 3 | NULL |
32+
* | srv_master_thread | 13 | 17.60 ms | 8.49 us | 1.35 ms | 9.99 ms | 16 | NULL |
33+
* | srv_purge_thread | 4 | 1.81 ms | 34.31 us | 452.45 us | 1.02 ms | 17 | NULL |
34+
* | io_write_thread | 19 | 951.39 us | 9.75 us | 50.07 us | 297.47 us | 10 | NULL |
35+
* | signal_handler | 3 | 218.03 us | 21.64 us | 72.68 us | 154.84 us | 19 | NULL |
36+
* +---------------------+-------+---------------+-------------+-------------+-------------+-----------+----------------+
3737
*
3838
*/
3939

@@ -43,7 +43,7 @@ CREATE OR REPLACE
4343
SQL SECURITY INVOKER
4444
VIEW io_by_thread_by_latency (
4545
user,
46-
count_star,
46+
total,
4747
total_latency,
4848
min_latency,
4949
avg_latency,
@@ -56,7 +56,7 @@ SELECT IF(processlist_id IS NULL,
5656
SUBSTRING_INDEX(name, '/', -1),
5757
CONCAT(processlist_user, '@', processlist_host)
5858
) user,
59-
SUM(count_star) count_star,
59+
SUM(count_star) total,
6060
sys.format_time(SUM(sum_timer_wait)) total_latency,
6161
sys.format_time(MIN(min_timer_wait)) min_latency,
6262
sys.format_time(AVG(avg_timer_wait)) avg_latency,
@@ -76,21 +76,21 @@ SELECT IF(processlist_id IS NULL,
7676
* Show the top IO consumers by thread, ordered by total latency
7777
*
7878
* mysql> select * from x$io_by_thread_by_latency;
79-
* +---------------------+------------+----------------+-------------+-----------------+--------------+-----------+----------------+
80-
* | user | count_star | total_latency | min_latency | avg_latency | max_latency | thread_id | processlist_id |
81-
* +---------------------+------------+----------------+-------------+-----------------+--------------+-----------+----------------+
82-
* | root@localhost | 11587 | 18007539905680 | 429780 | 1120831681.6667 | 181065665560 | 25 | 6 |
83-
* | main | 1358 | 1309001741320 | 475020 | 2269581997.8000 | 350700491310 | 1 | NULL |
84-
* | page_cleaner_thread | 654 | 147435455960 | 588120 | 225436198.0000 | 46412043990 | 18 | NULL |
85-
* | io_write_thread | 131 | 107754483070 | 8603140 | 822553303.0000 | 27691592500 | 8 | NULL |
86-
* | io_write_thread | 46 | 47074926860 | 10642710 | 1023367631.0000 | 16899745070 | 9 | NULL |
87-
* | io_write_thread | 71 | 46988801210 | 9108320 | 661814075.0000 | 17042760020 | 11 | NULL |
88-
* | io_log_thread | 20 | 21007710490 | 14250600 | 1050385336.0000 | 7081255090 | 3 | NULL |
89-
* | srv_master_thread | 13 | 17601511720 | 8486270 | 1353962324.0000 | 9990100380 | 16 | NULL |
90-
* | srv_purge_thread | 4 | 1809792270 | 34307000 | 452447879.0000 | 1018887740 | 17 | NULL |
91-
* | io_write_thread | 19 | 951385890 | 9745450 | 50072763.0000 | 297468080 | 10 | NULL |
92-
* | signal_handler | 3 | 218026640 | 21639800 | 72675421.0000 | 154841440 | 19 | NULL |
93-
* +---------------------+------------+----------------+-------------+-----------------+--------------+-----------+----------------+
79+
* +---------------------+-------+----------------+-------------+-----------------+--------------+-----------+----------------+
80+
* | user | total | total_latency | min_latency | avg_latency | max_latency | thread_id | processlist_id |
81+
* +---------------------+-------+----------------+-------------+-----------------+--------------+-----------+----------------+
82+
* | root@localhost | 11587 | 18007539905680 | 429780 | 1120831681.6667 | 181065665560 | 25 | 6 |
83+
* | main | 1358 | 1309001741320 | 475020 | 2269581997.8000 | 350700491310 | 1 | NULL |
84+
* | page_cleaner_thread | 654 | 147435455960 | 588120 | 225436198.0000 | 46412043990 | 18 | NULL |
85+
* | io_write_thread | 131 | 107754483070 | 8603140 | 822553303.0000 | 27691592500 | 8 | NULL |
86+
* | io_write_thread | 46 | 47074926860 | 10642710 | 1023367631.0000 | 16899745070 | 9 | NULL |
87+
* | io_write_thread | 71 | 46988801210 | 9108320 | 661814075.0000 | 17042760020 | 11 | NULL |
88+
* | io_log_thread | 20 | 21007710490 | 14250600 | 1050385336.0000 | 7081255090 | 3 | NULL |
89+
* | srv_master_thread | 13 | 17601511720 | 8486270 | 1353962324.0000 | 9990100380 | 16 | NULL |
90+
* | srv_purge_thread | 4 | 1809792270 | 34307000 | 452447879.0000 | 1018887740 | 17 | NULL |
91+
* | io_write_thread | 19 | 951385890 | 9745450 | 50072763.0000 | 297468080 | 10 | NULL |
92+
* | signal_handler | 3 | 218026640 | 21639800 | 72675421.0000 | 154841440 | 19 | NULL |
93+
* +---------------------+-------+----------------+-------------+-----------------+--------------+-----------+----------------+
9494
*
9595
*/
9696

@@ -100,7 +100,7 @@ CREATE OR REPLACE
100100
SQL SECURITY INVOKER
101101
VIEW x$io_by_thread_by_latency (
102102
user,
103-
count_star,
103+
total,
104104
total_latency,
105105
min_latency,
106106
avg_latency,
@@ -113,7 +113,7 @@ SELECT IF(processlist_id IS NULL,
113113
SUBSTRING_INDEX(name, '/', -1),
114114
CONCAT(processlist_user, '@', processlist_host)
115115
) user,
116-
SUM(count_star) count_star,
116+
SUM(count_star) total,
117117
SUM(sum_timer_wait) total_latency,
118118
MIN(min_timer_wait) min_latency,
119119
AVG(avg_timer_wait) avg_latency,

views/p_s/io_global_by_file_by_latency.sql

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
* Shows the top global IO consumers by latency by file.
2020
*
2121
* mysql> select * from io_global_by_file_by_latency limit 5;
22-
* +-----------------------------------------------------------+------------+-----------+------------+--------------+-------------+---------------+------------+--------------+
23-
* | file | count_star | total | count_read | read_latency | count_write | write_latency | count_misc | misc_latency |
24-
* +-----------------------------------------------------------+------------+-----------+------------+--------------+-------------+---------------+------------+--------------+
25-
* | @@datadir/sys/wait_classes_global_by_avg_latency_raw.frm~ | 24 | 451.99 ms | 0 | 0 ps | 4 | 108.07 us | 20 | 451.88 ms |
26-
* | @@datadir/sys/innodb_buffer_stats_by_schema_raw.frm~ | 24 | 379.84 ms | 0 | 0 ps | 4 | 108.88 us | 20 | 379.73 ms |
27-
* | @@datadir/sys/io_by_thread_by_latency_raw.frm~ | 24 | 379.46 ms | 0 | 0 ps | 4 | 101.37 us | 20 | 379.36 ms |
28-
* | @@datadir/ibtmp1 | 53 | 373.45 ms | 0 | 0 ps | 48 | 246.08 ms | 5 | 127.37 ms |
29-
* | @@datadir/sys/statement_analysis_raw.frm~ | 24 | 353.14 ms | 0 | 0 ps | 4 | 94.96 us | 20 | 353.04 ms |
30-
* +-----------------------------------------------------------+------------+-----------+------------+--------------+-------------+---------------+------------+--------------+
22+
* +-----------------------------------------------------------+-------+---------------+------------+--------------+-------------+---------------+------------+--------------+
23+
* | file | total | total_latency | count_read | read_latency | count_write | write_latency | count_misc | misc_latency |
24+
* +-----------------------------------------------------------+-------+---------------+------------+--------------+-------------+---------------+------------+--------------+
25+
* | @@datadir/sys/wait_classes_global_by_avg_latency_raw.frm~ | 24 | 451.99 ms | 0 | 0 ps | 4 | 108.07 us | 20 | 451.88 ms |
26+
* | @@datadir/sys/innodb_buffer_stats_by_schema_raw.frm~ | 24 | 379.84 ms | 0 | 0 ps | 4 | 108.88 us | 20 | 379.73 ms |
27+
* | @@datadir/sys/io_by_thread_by_latency_raw.frm~ | 24 | 379.46 ms | 0 | 0 ps | 4 | 101.37 us | 20 | 379.36 ms |
28+
* | @@datadir/ibtmp1 | 53 | 373.45 ms | 0 | 0 ps | 48 | 246.08 ms | 5 | 127.37 ms |
29+
* | @@datadir/sys/statement_analysis_raw.frm~ | 24 | 353.14 ms | 0 | 0 ps | 4 | 94.96 us | 20 | 353.04 ms |
30+
* +-----------------------------------------------------------+-------+---------------+------------+--------------+-------------+---------------+------------+--------------+
3131
*
3232
*/
3333

@@ -64,15 +64,15 @@ SELECT sys.format_path(file_name) AS file,
6464
* Shows the top global IO consumers by latency by file.
6565
*
6666
* mysql> select * from x$io_global_by_file_by_latency limit 5;
67-
* +--------------------------------------------------------------------------------------+------------+---------------+------------+--------------+-------------+---------------+------------+--------------+
68-
* | file | count_star | total | count_read | read_latency | count_write | write_latency | count_misc | misc_latency |
69-
* +--------------------------------------------------------------------------------------+------------+---------------+------------+--------------+-------------+---------------+------------+--------------+
70-
* | /Users/mark/sandboxes/msb_5_7_2/data/sys/wait_classes_global_by_avg_latency_raw.frm~ | 30 | 513959738110 | 0 | 0 | 5 | 132130960 | 25 | 513827607150 |
71-
* | /Users/mark/sandboxes/msb_5_7_2/data/sys/innodb_buffer_stats_by_schema_raw.frm~ | 30 | 490149888410 | 0 | 0 | 5 | 483887040 | 25 | 489666001370 |
72-
* | /Users/mark/sandboxes/msb_5_7_2/data/sys/io_by_thread_by_latency_raw.frm~ | 30 | 427724241620 | 0 | 0 | 5 | 131399580 | 25 | 427592842040 |
73-
* | /Users/mark/sandboxes/msb_5_7_2/data/sys/innodb_buffer_stats_by_schema.frm~ | 30 | 406392559950 | 0 | 0 | 5 | 104082160 | 25 | 406288477790 |
74-
* | /Users/mark/sandboxes/msb_5_7_2/data/sys/statement_analysis_raw.frm~ | 30 | 395527510430 | 0 | 0 | 5 | 118724840 | 25 | 395408785590 |
75-
* +--------------------------------------------------------------------------------------+------------+---------------+------------+--------------+-------------+---------------+------------+--------------+
67+
* +--------------------------------------------------------------------------------------+-------+---------------+------------+--------------+-------------+---------------+------------+--------------+
68+
* | file | total | total_latency | count_read | read_latency | count_write | write_latency | count_misc | misc_latency |
69+
* +--------------------------------------------------------------------------------------+-------+---------------+------------+--------------+-------------+---------------+------------+--------------+
70+
* | /Users/mark/sandboxes/msb_5_7_2/data/sys/wait_classes_global_by_avg_latency_raw.frm~ | 30 | 513959738110 | 0 | 0 | 5 | 132130960 | 25 | 513827607150 |
71+
* | /Users/mark/sandboxes/msb_5_7_2/data/sys/innodb_buffer_stats_by_schema_raw.frm~ | 30 | 490149888410 | 0 | 0 | 5 | 483887040 | 25 | 489666001370 |
72+
* | /Users/mark/sandboxes/msb_5_7_2/data/sys/io_by_thread_by_latency_raw.frm~ | 30 | 427724241620 | 0 | 0 | 5 | 131399580 | 25 | 427592842040 |
73+
* | /Users/mark/sandboxes/msb_5_7_2/data/sys/innodb_buffer_stats_by_schema.frm~ | 30 | 406392559950 | 0 | 0 | 5 | 104082160 | 25 | 406288477790 |
74+
* | /Users/mark/sandboxes/msb_5_7_2/data/sys/statement_analysis_raw.frm~ | 30 | 395527510430 | 0 | 0 | 5 | 118724840 | 25 | 395408785590 |
75+
* +--------------------------------------------------------------------------------------+-------+---------------+------------+--------------+-------------+---------------+------------+--------------+
7676
*
7777
*/
7878

0 commit comments

Comments
 (0)