Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
weilin committed Dec 17, 2020
0 parents commit 9638594
Show file tree
Hide file tree
Showing 299 changed files with 1,933 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Created by .ignore support plugin (hsz.mobi)

vendor
*/vendor
.idea
*.log
qms
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

# 文档整理
- https://www.cnblogs.com/ivictor/p/5979731.html

interactive_timeout针对交互式连接,wait_timeout针对非交互式连接

- https://blog.csdn.net/idwtwt/article/details/91345364
- https://blog.csdn.net/dghpgyss/article/details/86480837

mysql防止空闲连接过多,超过了mysql_connection配置之后,会拒绝新连接,
自动关闭空闲连接超过wait_timeout、使用中连接超过interactive_timeout参数的连接

database/sql库连接池的max_lifetime大于wait_timeout,有可能拿到失效连接,
建议设置wait_timeout/2


- https://github.com/go-sql-driver/mysql/pull/934

go-sql-driver/mysql 1.5版本增加失效连接 读写前检查



# 测试方案

## mysql配置

mysql 5.7
max_connections = 5
wait_timeout = 5


## 测试方案

仅修改go-sql-driver/mysql版本和SetConnMaxLifetime值

起5个go协程执行mysql查询,之后sleep 10s,循环执行该操作,观察报错信息


| go-sql-driver/mysql | SetConnMaxLifetime | 结果|
| -- | -- | -- |
| 1.4.1 | 20s | 稳定出现invalid connection |
| 1.4.1| 2.5s | 未出现invalid connection; maxLifetimeClosed持续增加 |
| 1.5.0 | 20s | 出现报错closing bad idle connection: EOF,但是可以正常查询 |

- 并发原因

- 触发wait_timeout
2 changes: 2 additions & 0 deletions mysql/data/auto.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[auto]
server-uuid=6c6ff47e-402d-11eb-9477-0242ac120002
Binary file added mysql/data/ca-key.pem
Binary file not shown.
Binary file added mysql/data/ca.pem
Binary file not shown.
Binary file added mysql/data/client-cert.pem
Binary file not shown.
Binary file added mysql/data/client-key.pem
Binary file not shown.
99 changes: 99 additions & 0 deletions mysql/data/ib_buffer_pool
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
25,3
25,2
0,9
25,1
25,0
24,52
24,51
24,50
24,49
24,48
24,47
24,46
24,45
24,44
24,43
24,42
24,41
24,40
24,39
24,38
24,37
24,36
17,2
17,1
17,3
15,2
15,1
15,3
16,2
16,1
16,3
13,2
14,2
4,25
4,40
4,17
4,41
4,4
4,82
4,88
4,70
4,77
4,80
4,86
4,1
4,7
4,2
4,3
6,6
6,8
6,1
6,5
6,2
6,3
7,8
7,10
7,7
7,4
7,9
7,1
7,5
7,2
7,3
5,4
5,2
5,1
5,3
24,35
3,1
3,3
10,170
10,20
10,218
10,6
10,192
10,146
10,136
11,11
11,20
11,19
9,7
9,4
9,6
8,15
8,16
8,12
8,14
8,18
20,2
20,1
20,3
19,2
19,1
19,3
12,3
12,2
12,1
11,30
11,29
Binary file added mysql/data/ib_logfile0
Binary file not shown.
Binary file added mysql/data/ib_logfile1
Binary file not shown.
Binary file added mysql/data/ibdata1
Binary file not shown.
Binary file added mysql/data/ibtmp1
Binary file not shown.
Empty file.
Binary file added mysql/data/mysql/columns_priv.MYI
Binary file not shown.
Binary file added mysql/data/mysql/columns_priv.frm
Binary file not shown.
1 change: 1 addition & 0 deletions mysql/data/mysql/db.MYD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
�localhost performance_schema mysql.session �localhost sys mysql.sys 
Binary file added mysql/data/mysql/db.MYI
Binary file not shown.
Binary file added mysql/data/mysql/db.frm
Binary file not shown.
2 changes: 2 additions & 0 deletions mysql/data/mysql/db.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
default-character-set=latin1
default-collation=latin1_swedish_ci
Binary file added mysql/data/mysql/engine_cost.frm
Binary file not shown.
Binary file added mysql/data/mysql/engine_cost.ibd
Binary file not shown.
Empty file added mysql/data/mysql/event.MYD
Empty file.
Binary file added mysql/data/mysql/event.MYI
Binary file not shown.
Binary file added mysql/data/mysql/event.frm
Binary file not shown.
Empty file added mysql/data/mysql/func.MYD
Empty file.
Binary file added mysql/data/mysql/func.MYI
Binary file not shown.
Binary file added mysql/data/mysql/func.frm
Binary file not shown.
Binary file added mysql/data/mysql/general_log.CSM
Binary file not shown.
Empty file.
Binary file added mysql/data/mysql/general_log.frm
Binary file not shown.
Binary file added mysql/data/mysql/gtid_executed.frm
Binary file not shown.
Binary file added mysql/data/mysql/gtid_executed.ibd
Binary file not shown.
Binary file added mysql/data/mysql/help_category.frm
Binary file not shown.
Binary file added mysql/data/mysql/help_category.ibd
Binary file not shown.
Binary file added mysql/data/mysql/help_keyword.frm
Binary file not shown.
Binary file added mysql/data/mysql/help_keyword.ibd
Binary file not shown.
Binary file added mysql/data/mysql/help_relation.frm
Binary file not shown.
Binary file added mysql/data/mysql/help_relation.ibd
Binary file not shown.
Binary file added mysql/data/mysql/help_topic.frm
Binary file not shown.
Binary file added mysql/data/mysql/help_topic.ibd
Binary file not shown.
Binary file added mysql/data/mysql/innodb_index_stats.frm
Binary file not shown.
Binary file added mysql/data/mysql/innodb_index_stats.ibd
Binary file not shown.
Binary file added mysql/data/mysql/innodb_table_stats.frm
Binary file not shown.
Binary file added mysql/data/mysql/innodb_table_stats.ibd
Binary file not shown.
Empty file.
Binary file added mysql/data/mysql/ndb_binlog_index.MYI
Binary file not shown.
Binary file added mysql/data/mysql/ndb_binlog_index.frm
Binary file not shown.
Binary file added mysql/data/mysql/plugin.frm
Binary file not shown.
Binary file added mysql/data/mysql/plugin.ibd
Binary file not shown.
Binary file added mysql/data/mysql/proc.MYD
Binary file not shown.
Binary file added mysql/data/mysql/proc.MYI
Binary file not shown.
Binary file added mysql/data/mysql/proc.frm
Binary file not shown.
Empty file added mysql/data/mysql/procs_priv.MYD
Empty file.
Binary file added mysql/data/mysql/procs_priv.MYI
Binary file not shown.
Binary file added mysql/data/mysql/procs_priv.frm
Binary file not shown.
Binary file added mysql/data/mysql/proxies_priv.MYD
Binary file not shown.
Binary file added mysql/data/mysql/proxies_priv.MYI
Binary file not shown.
Binary file added mysql/data/mysql/proxies_priv.frm
Binary file not shown.
Binary file added mysql/data/mysql/server_cost.frm
Binary file not shown.
Binary file added mysql/data/mysql/server_cost.ibd
Binary file not shown.
Binary file added mysql/data/mysql/servers.frm
Binary file not shown.
Binary file added mysql/data/mysql/servers.ibd
Binary file not shown.
Binary file added mysql/data/mysql/slave_master_info.frm
Binary file not shown.
Binary file added mysql/data/mysql/slave_master_info.ibd
Binary file not shown.
Binary file added mysql/data/mysql/slave_relay_log_info.frm
Binary file not shown.
Binary file added mysql/data/mysql/slave_relay_log_info.ibd
Binary file not shown.
Binary file added mysql/data/mysql/slave_worker_info.frm
Binary file not shown.
Binary file added mysql/data/mysql/slave_worker_info.ibd
Binary file not shown.
Binary file added mysql/data/mysql/slow_log.CSM
Binary file not shown.
Empty file added mysql/data/mysql/slow_log.CSV
Empty file.
Binary file added mysql/data/mysql/slow_log.frm
Binary file not shown.
Binary file added mysql/data/mysql/tables_priv.MYD
Binary file not shown.
Binary file added mysql/data/mysql/tables_priv.MYI
Binary file not shown.
Binary file added mysql/data/mysql/tables_priv.frm
Binary file not shown.
Binary file added mysql/data/mysql/time_zone.frm
Binary file not shown.
Binary file added mysql/data/mysql/time_zone.ibd
Binary file not shown.
Binary file added mysql/data/mysql/time_zone_leap_second.frm
Binary file not shown.
Binary file added mysql/data/mysql/time_zone_leap_second.ibd
Binary file not shown.
Binary file added mysql/data/mysql/time_zone_name.frm
Binary file not shown.
Binary file added mysql/data/mysql/time_zone_name.ibd
Binary file not shown.
Binary file added mysql/data/mysql/time_zone_transition.frm
Binary file not shown.
Binary file added mysql/data/mysql/time_zone_transition.ibd
Binary file not shown.
Binary file added mysql/data/mysql/time_zone_transition_type.frm
Binary file not shown.
Binary file added mysql/data/mysql/time_zone_transition_type.ibd
Binary file not shown.
Binary file added mysql/data/mysql/user.MYD
Binary file not shown.
Binary file added mysql/data/mysql/user.MYI
Binary file not shown.
Binary file added mysql/data/mysql/user.frm
Binary file not shown.
Binary file added mysql/data/performance_schema/accounts.frm
Binary file not shown.
Binary file added mysql/data/performance_schema/cond_instances.frm
Binary file not shown.
2 changes: 2 additions & 0 deletions mysql/data/performance_schema/db.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
default-character-set=utf8
default-collation=utf8_general_ci
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added mysql/data/performance_schema/file_instances.frm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added mysql/data/performance_schema/global_status.frm
Binary file not shown.
Binary file not shown.
Binary file added mysql/data/performance_schema/host_cache.frm
Binary file not shown.
Binary file added mysql/data/performance_schema/hosts.frm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added mysql/data/performance_schema/metadata_locks.frm
Binary file not shown.
Binary file added mysql/data/performance_schema/mutex_instances.frm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added mysql/data/performance_schema/session_status.frm
Binary file not shown.
Binary file not shown.
Binary file added mysql/data/performance_schema/setup_actors.frm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added mysql/data/performance_schema/setup_objects.frm
Binary file not shown.
Binary file added mysql/data/performance_schema/setup_timers.frm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added mysql/data/performance_schema/status_by_host.frm
Binary file not shown.
Binary file not shown.
Binary file added mysql/data/performance_schema/status_by_user.frm
Binary file not shown.
Binary file added mysql/data/performance_schema/table_handles.frm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added mysql/data/performance_schema/threads.frm
Binary file not shown.
Binary file not shown.
Binary file added mysql/data/performance_schema/users.frm
Binary file not shown.
Binary file not shown.
Binary file added mysql/data/private_key.pem
Binary file not shown.
Binary file added mysql/data/public_key.pem
Binary file not shown.
Binary file added mysql/data/server-cert.pem
Binary file not shown.
Binary file added mysql/data/server-key.pem
Binary file not shown.
2 changes: 2 additions & 0 deletions mysql/data/sys/db.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
default-character-set=utf8
default-collation=utf8_general_ci
15 changes: 15 additions & 0 deletions mysql/data/sys/host_summary.frm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
TYPE=VIEW
query=select if(isnull(`performance_schema`.`accounts`.`HOST`),\'background\',`performance_schema`.`accounts`.`HOST`) AS `host`,sum(`stmt`.`total`) AS `statements`,`sys`.`format_time`(sum(`stmt`.`total_latency`)) AS `statement_latency`,`sys`.`format_time`(ifnull((sum(`stmt`.`total_latency`) / nullif(sum(`stmt`.`total`),0)),0)) AS `statement_avg_latency`,sum(`stmt`.`full_scans`) AS `table_scans`,sum(`io`.`ios`) AS `file_ios`,`sys`.`format_time`(sum(`io`.`io_latency`)) AS `file_io_latency`,sum(`performance_schema`.`accounts`.`CURRENT_CONNECTIONS`) AS `current_connections`,sum(`performance_schema`.`accounts`.`TOTAL_CONNECTIONS`) AS `total_connections`,count(distinct `performance_schema`.`accounts`.`USER`) AS `unique_users`,`sys`.`format_bytes`(sum(`mem`.`current_allocated`)) AS `current_memory`,`sys`.`format_bytes`(sum(`mem`.`total_allocated`)) AS `total_memory_allocated` from (((`performance_schema`.`accounts` join `sys`.`x$host_summary_by_statement_latency` `stmt` on((`performance_schema`.`accounts`.`HOST` = `stmt`.`host`))) join `sys`.`x$host_summary_by_file_io` `io` on((`performance_schema`.`accounts`.`HOST` = `io`.`host`))) join `sys`.`x$memory_by_host_by_current_bytes` `mem` on((`performance_schema`.`accounts`.`HOST` = `mem`.`host`))) group by if(isnull(`performance_schema`.`accounts`.`HOST`),\'background\',`performance_schema`.`accounts`.`HOST`)
md5=e079676ec756edbb811a11a2d649f6e4
updatable=0
algorithm=1
definer_user=mysql.sys
definer_host=localhost
suid=0
with_check_option=0
timestamp=2020-12-17 06:02:30
create-version=1
source=SELECT IF(accounts.host IS NULL, \'background\', accounts.host) AS host, SUM(stmt.total) AS statements, sys.format_time(SUM(stmt.total_latency)) AS statement_latency, sys.format_time(IFNULL(SUM(stmt.total_latency) / NULLIF(SUM(stmt.total), 0), 0)) AS statement_avg_latency, SUM(stmt.full_scans) AS table_scans, SUM(io.ios) AS file_ios, sys.format_time(SUM(io.io_latency)) AS file_io_latency, SUM(accounts.current_connections) AS current_connections, SUM(accounts.total_connections) AS total_connections, COUNT(DISTINCT user) AS unique_users, sys.format_bytes(SUM(mem.current_allocated)) AS current_memory, sys.format_bytes(SUM(mem.total_allocated)) AS total_memory_allocated FROM performance_schema.accounts JOIN sys.x$host_summary_by_statement_latency AS stmt ON accounts.host = stmt.host JOIN sys.x$host_summary_by_file_io AS io ON accounts.host = io.host JOIN sys.x$memory_by_host_by_current_bytes mem ON accounts.host = mem.host GROUP BY IF(accounts.host IS NULL, \'background\', accounts.host)
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select if(isnull(`performance_schema`.`accounts`.`HOST`),\'background\',`performance_schema`.`accounts`.`HOST`) AS `host`,sum(`stmt`.`total`) AS `statements`,`sys`.`format_time`(sum(`stmt`.`total_latency`)) AS `statement_latency`,`sys`.`format_time`(ifnull((sum(`stmt`.`total_latency`) / nullif(sum(`stmt`.`total`),0)),0)) AS `statement_avg_latency`,sum(`stmt`.`full_scans`) AS `table_scans`,sum(`io`.`ios`) AS `file_ios`,`sys`.`format_time`(sum(`io`.`io_latency`)) AS `file_io_latency`,sum(`performance_schema`.`accounts`.`CURRENT_CONNECTIONS`) AS `current_connections`,sum(`performance_schema`.`accounts`.`TOTAL_CONNECTIONS`) AS `total_connections`,count(distinct `performance_schema`.`accounts`.`USER`) AS `unique_users`,`sys`.`format_bytes`(sum(`mem`.`current_allocated`)) AS `current_memory`,`sys`.`format_bytes`(sum(`mem`.`total_allocated`)) AS `total_memory_allocated` from (((`performance_schema`.`accounts` join `sys`.`x$host_summary_by_statement_latency` `stmt` on((`performance_schema`.`accounts`.`HOST` = `stmt`.`host`))) join `sys`.`x$host_summary_by_file_io` `io` on((`performance_schema`.`accounts`.`HOST` = `io`.`host`))) join `sys`.`x$memory_by_host_by_current_bytes` `mem` on((`performance_schema`.`accounts`.`HOST` = `mem`.`host`))) group by if(isnull(`performance_schema`.`accounts`.`HOST`),\'background\',`performance_schema`.`accounts`.`HOST`)
15 changes: 15 additions & 0 deletions mysql/data/sys/host_summary_by_file_io.frm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
TYPE=VIEW
query=select if(isnull(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`HOST`),\'background\',`performance_schema`.`events_waits_summary_by_host_by_event_name`.`HOST`) AS `host`,sum(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`COUNT_STAR`) AS `ios`,`sys`.`format_time`(sum(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`SUM_TIMER_WAIT`)) AS `io_latency` from `performance_schema`.`events_waits_summary_by_host_by_event_name` where (`performance_schema`.`events_waits_summary_by_host_by_event_name`.`EVENT_NAME` like \'wait/io/file/%\') group by if(isnull(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`HOST`),\'background\',`performance_schema`.`events_waits_summary_by_host_by_event_name`.`HOST`) order by sum(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`SUM_TIMER_WAIT`) desc
md5=53b0d9b1a70d1f81690a79d9d4d8f59c
updatable=0
algorithm=1
definer_user=mysql.sys
definer_host=localhost
suid=0
with_check_option=0
timestamp=2020-12-17 06:02:30
create-version=1
source=SELECT IF(host IS NULL, \'background\', host) AS host, SUM(count_star) AS ios, sys.format_time(SUM(sum_timer_wait)) AS io_latency FROM performance_schema.events_waits_summary_by_host_by_event_name WHERE event_name LIKE \'wait/io/file/%\' GROUP BY IF(host IS NULL, \'background\', host) ORDER BY SUM(sum_timer_wait) DESC
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select if(isnull(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`HOST`),\'background\',`performance_schema`.`events_waits_summary_by_host_by_event_name`.`HOST`) AS `host`,sum(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`COUNT_STAR`) AS `ios`,`sys`.`format_time`(sum(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`SUM_TIMER_WAIT`)) AS `io_latency` from `performance_schema`.`events_waits_summary_by_host_by_event_name` where (`performance_schema`.`events_waits_summary_by_host_by_event_name`.`EVENT_NAME` like \'wait/io/file/%\') group by if(isnull(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`HOST`),\'background\',`performance_schema`.`events_waits_summary_by_host_by_event_name`.`HOST`) order by sum(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`SUM_TIMER_WAIT`) desc
15 changes: 15 additions & 0 deletions mysql/data/sys/host_summary_by_file_io_type.frm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
TYPE=VIEW
query=select if(isnull(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`HOST`),\'background\',`performance_schema`.`events_waits_summary_by_host_by_event_name`.`HOST`) AS `host`,`performance_schema`.`events_waits_summary_by_host_by_event_name`.`EVENT_NAME` AS `event_name`,`performance_schema`.`events_waits_summary_by_host_by_event_name`.`COUNT_STAR` AS `total`,`sys`.`format_time`(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`SUM_TIMER_WAIT`) AS `total_latency`,`sys`.`format_time`(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`MAX_TIMER_WAIT`) AS `max_latency` from `performance_schema`.`events_waits_summary_by_host_by_event_name` where ((`performance_schema`.`events_waits_summary_by_host_by_event_name`.`EVENT_NAME` like \'wait/io/file%\') and (`performance_schema`.`events_waits_summary_by_host_by_event_name`.`COUNT_STAR` > 0)) order by if(isnull(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`HOST`),\'background\',`performance_schema`.`events_waits_summary_by_host_by_event_name`.`HOST`),`performance_schema`.`events_waits_summary_by_host_by_event_name`.`SUM_TIMER_WAIT` desc
md5=58bace9fd830c2b849772ce5d565917e
updatable=1
algorithm=2
definer_user=mysql.sys
definer_host=localhost
suid=0
with_check_option=0
timestamp=2020-12-17 06:02:30
create-version=1
source=SELECT IF(host IS NULL, \'background\', host) AS host, event_name, count_star AS total, sys.format_time(sum_timer_wait) AS total_latency, sys.format_time(max_timer_wait) AS max_latency FROM performance_schema.events_waits_summary_by_host_by_event_name WHERE event_name LIKE \'wait/io/file%\' AND count_star > 0 ORDER BY IF(host IS NULL, \'background\', host), sum_timer_wait DESC
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select if(isnull(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`HOST`),\'background\',`performance_schema`.`events_waits_summary_by_host_by_event_name`.`HOST`) AS `host`,`performance_schema`.`events_waits_summary_by_host_by_event_name`.`EVENT_NAME` AS `event_name`,`performance_schema`.`events_waits_summary_by_host_by_event_name`.`COUNT_STAR` AS `total`,`sys`.`format_time`(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`SUM_TIMER_WAIT`) AS `total_latency`,`sys`.`format_time`(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`MAX_TIMER_WAIT`) AS `max_latency` from `performance_schema`.`events_waits_summary_by_host_by_event_name` where ((`performance_schema`.`events_waits_summary_by_host_by_event_name`.`EVENT_NAME` like \'wait/io/file%\') and (`performance_schema`.`events_waits_summary_by_host_by_event_name`.`COUNT_STAR` > 0)) order by if(isnull(`performance_schema`.`events_waits_summary_by_host_by_event_name`.`HOST`),\'background\',`performance_schema`.`events_waits_summary_by_host_by_event_name`.`HOST`),`performance_schema`.`events_waits_summary_by_host_by_event_name`.`SUM_TIMER_WAIT` desc
15 changes: 15 additions & 0 deletions mysql/data/sys/host_summary_by_stages.frm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
TYPE=VIEW
query=select if(isnull(`performance_schema`.`events_stages_summary_by_host_by_event_name`.`HOST`),\'background\',`performance_schema`.`events_stages_summary_by_host_by_event_name`.`HOST`) AS `host`,`performance_schema`.`events_stages_summary_by_host_by_event_name`.`EVENT_NAME` AS `event_name`,`performance_schema`.`events_stages_summary_by_host_by_event_name`.`COUNT_STAR` AS `total`,`sys`.`format_time`(`performance_schema`.`events_stages_summary_by_host_by_event_name`.`SUM_TIMER_WAIT`) AS `total_latency`,`sys`.`format_time`(`performance_schema`.`events_stages_summary_by_host_by_event_name`.`AVG_TIMER_WAIT`) AS `avg_latency` from `performance_schema`.`events_stages_summary_by_host_by_event_name` where (`performance_schema`.`events_stages_summary_by_host_by_event_name`.`SUM_TIMER_WAIT` <> 0) order by if(isnull(`performance_schema`.`events_stages_summary_by_host_by_event_name`.`HOST`),\'background\',`performance_schema`.`events_stages_summary_by_host_by_event_name`.`HOST`),`performance_schema`.`events_stages_summary_by_host_by_event_name`.`SUM_TIMER_WAIT` desc
md5=b6ea9b98daa223ec9e82b8abb20f25f0
updatable=1
algorithm=2
definer_user=mysql.sys
definer_host=localhost
suid=0
with_check_option=0
timestamp=2020-12-17 06:02:30
create-version=1
source=SELECT IF(host IS NULL, \'background\', host) AS host, event_name, count_star AS total, sys.format_time(sum_timer_wait) AS total_latency, sys.format_time(avg_timer_wait) AS avg_latency FROM performance_schema.events_stages_summary_by_host_by_event_name WHERE sum_timer_wait != 0 ORDER BY IF(host IS NULL, \'background\', host), sum_timer_wait DESC
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select if(isnull(`performance_schema`.`events_stages_summary_by_host_by_event_name`.`HOST`),\'background\',`performance_schema`.`events_stages_summary_by_host_by_event_name`.`HOST`) AS `host`,`performance_schema`.`events_stages_summary_by_host_by_event_name`.`EVENT_NAME` AS `event_name`,`performance_schema`.`events_stages_summary_by_host_by_event_name`.`COUNT_STAR` AS `total`,`sys`.`format_time`(`performance_schema`.`events_stages_summary_by_host_by_event_name`.`SUM_TIMER_WAIT`) AS `total_latency`,`sys`.`format_time`(`performance_schema`.`events_stages_summary_by_host_by_event_name`.`AVG_TIMER_WAIT`) AS `avg_latency` from `performance_schema`.`events_stages_summary_by_host_by_event_name` where (`performance_schema`.`events_stages_summary_by_host_by_event_name`.`SUM_TIMER_WAIT` <> 0) order by if(isnull(`performance_schema`.`events_stages_summary_by_host_by_event_name`.`HOST`),\'background\',`performance_schema`.`events_stages_summary_by_host_by_event_name`.`HOST`),`performance_schema`.`events_stages_summary_by_host_by_event_name`.`SUM_TIMER_WAIT` desc
15 changes: 15 additions & 0 deletions mysql/data/sys/host_summary_by_statement_latency.frm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
TYPE=VIEW
query=select if(isnull(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`HOST`),\'background\',`performance_schema`.`events_statements_summary_by_host_by_event_name`.`HOST`) AS `host`,sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`COUNT_STAR`) AS `total`,`sys`.`format_time`(sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`SUM_TIMER_WAIT`)) AS `total_latency`,`sys`.`format_time`(max(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`MAX_TIMER_WAIT`)) AS `max_latency`,`sys`.`format_time`(sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`SUM_LOCK_TIME`)) AS `lock_latency`,sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`SUM_ROWS_SENT`) AS `rows_sent`,sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`SUM_ROWS_EXAMINED`) AS `rows_examined`,sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`SUM_ROWS_AFFECTED`) AS `rows_affected`,(sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`SUM_NO_INDEX_USED`) + sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`SUM_NO_GOOD_INDEX_USED`)) AS `full_scans` from `performance_schema`.`events_statements_summary_by_host_by_event_name` group by if(isnull(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`HOST`),\'background\',`performance_schema`.`events_statements_summary_by_host_by_event_name`.`HOST`) order by sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`SUM_TIMER_WAIT`) desc
md5=61a6f2a6ed0dc94b05f4ed232d72e2b1
updatable=0
algorithm=1
definer_user=mysql.sys
definer_host=localhost
suid=0
with_check_option=0
timestamp=2020-12-17 06:02:30
create-version=1
source=SELECT IF(host IS NULL, \'background\', host) AS host, SUM(count_star) AS total, sys.format_time(SUM(sum_timer_wait)) AS total_latency, sys.format_time(MAX(max_timer_wait)) AS max_latency, sys.format_time(SUM(sum_lock_time)) AS lock_latency, SUM(sum_rows_sent) AS rows_sent, SUM(sum_rows_examined) AS rows_examined, SUM(sum_rows_affected) AS rows_affected, SUM(sum_no_index_used) + SUM(sum_no_good_index_used) AS full_scans FROM performance_schema.events_statements_summary_by_host_by_event_name GROUP BY IF(host IS NULL, \'background\', host) ORDER BY SUM(sum_timer_wait) DESC
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select if(isnull(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`HOST`),\'background\',`performance_schema`.`events_statements_summary_by_host_by_event_name`.`HOST`) AS `host`,sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`COUNT_STAR`) AS `total`,`sys`.`format_time`(sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`SUM_TIMER_WAIT`)) AS `total_latency`,`sys`.`format_time`(max(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`MAX_TIMER_WAIT`)) AS `max_latency`,`sys`.`format_time`(sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`SUM_LOCK_TIME`)) AS `lock_latency`,sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`SUM_ROWS_SENT`) AS `rows_sent`,sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`SUM_ROWS_EXAMINED`) AS `rows_examined`,sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`SUM_ROWS_AFFECTED`) AS `rows_affected`,(sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`SUM_NO_INDEX_USED`) + sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`SUM_NO_GOOD_INDEX_USED`)) AS `full_scans` from `performance_schema`.`events_statements_summary_by_host_by_event_name` group by if(isnull(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`HOST`),\'background\',`performance_schema`.`events_statements_summary_by_host_by_event_name`.`HOST`) order by sum(`performance_schema`.`events_statements_summary_by_host_by_event_name`.`SUM_TIMER_WAIT`) desc
Loading

0 comments on commit 9638594

Please sign in to comment.