启用 slow log
有两种启用方式:1, 在my.cnf 里 通过 log-slow-queries[=file_name]
2, 在mysqld进程启动时,指定–log-slow-queries[=file_name]选项
比较的五款常用工具mysqldumpslow, mysqlsla, myprofi, mysql-explain-slow-log, mysqllogfilter
mysqldumpslow, mysql官方提供的慢查询日志分析工具. 输出图表如下:
主要功能是, 统计不同慢sql的
出现次数(Count),
执行最长时间(Time),
累计总耗费时间(Ti