mysql慢查询分析工具

pt-query-digest 慢查询查看工具

set profiling =1 开启后会将每一条sql语句的执行时间记录到一张临时表。

show profiles 查看的所有查询记录

show profile for query 临时表query_ID 查看具体某条语句的执行时间

show status 查看计数器

show global status 查看服务器的所有计数器

show processlist 观察是否有大量的线程处于不正常的状态

explain(desc) 分析单条sql语句

猜你喜欢

转载自blog.csdn.net/weixin_41111189/article/details/82857049