使用MySQL的Performance Schema

1.查看performance_schema
show variables like 'Performance_schema%';

2.查看存储引擎的状态显示总内存大小
show engine performance_schema status;

3.进入performance_schema,执行select语句setup_开头的表
use performance_schema;
show tables like 'setup\_%';

4.监控前台线程,前台线程是与客户端连接关联的线程。(那些用户需要收集信息)
select * from setup_actors;

5.那些对象需要收集信息,比如mysql表
select * from setup_objects;

6.计时定义表
select * from setup_timers;

7.收集仪器,每一个功能点都会有仪器的事件,开始和结束,然后开启那个仪器,就会收集那个仪器的数据
select * from setup_instruments;

8.那些仪器的分类需要收集
select * from setup_consumers;

9.看帮助文档
select * from table_io_waits_summary_by_table;

10.校验instruments是否启用
select * from setup_instruments where name like 'wait/io/table%';

  1. truncate table_io_waits_summary_by_table表
    truncate table table_io_waits_summary_by_table;

12.执行employees数据库
select * from employees.employees;

13.查object_schema,object_name,count_star,sum_timer_wait字段

select object_schema,object_name,count_star,sum_timer_wait
from table table_io_waits_summary_by_table
where object_schema='employees'
and object_name='employees';

14.执行以下查询
select sleep(5);

15.查询sys用户下的statments_with_runtimes_in_95th_percentile
select * from sys.statments_with_runtimes_in_95th_percentile\G

上一篇:需求管理之项目经理与客户沟通的宜与忌


下一篇:分析现有 WPF / Windows Forms 程序能否顺利迁移到 .NET Core 3.0(使用 .NET Core 3.0 Desktop API Analyzer )