性能监控
1、通过show profile 查看
多条sql执行之后查看
show profile
这个是查看最近执行的一句sql
show profile for query Query_ID(执行sql的ID)
查看第几个执行的sql
执行命令
set profiling = 1
show profiles
查看sql的执行时间
show profile
查看sql详细的执行时间
show profile在低版本中使用,高版本使用的是 preformance_schema
preformance_schema
使用的是preformance_schema存储引擎,监控所有的sql执行的时候server的资源消耗:IO等;数据存储在内存中,不进行持久化。
instruments 生产者 :监控采集配置项:采集mysql各种操作所产生的信息
consumer 消费者:存储采集的数据
2、schema 和数据类型优化
3、执行计划
4、索引优化