mysql 慢查询
来源:互联网 发布:拍立得效果软件 编辑:程序博客网 时间:2024/05/21 15:50
vim my.conf
log-queries-not-using-indexes = 0 #把慢查询以及执行时没有使用索引的查询命令全都记入日志(其余同--log-slow-queries选项)。slow-query-log = 1long_query_time = 2 #慢查询的执行用时上限(默认设置是10s)。slow-query-log-file = /data/mysql/mysql-slow.log
show variables like “%slow%”; #查看慢查询配置
--verbose verbose --debug debug --help write this text to standard output -v verbose -d debug -s ORDER what to sort by (al, at, ar, c, l, r, t), 'at' is default //排序 常用 al: average lock time ar: average rows sent at: average query time c: count l: lock time r: rows sent t: query time -r reverse the sort order (largest last instead of first)//逆序 -t NUM just show the top n queries //top NUM 常用 -a don't abstract all numbers to N and strings to 'S' //不使用N S来代替‘变量’ -n NUM abstract numbers with at least n digits within names -g PATTERN grep: only consider stmts that include this string // grep ‘string’常用 -h HOSTNAME hostname of db server for *-slow.log filename (can be wildcard), default is '*', i.e. match all -i NAME name of server instance (if using mysql.server startup script) -l don't subtract lock time from total time
mysqldumpslow -s t -t 10 -a -g "like" /log/mysql/slowbak.log #按查询时间排序 包括like字符的前十个
0 0
- mysql 慢查询分析
- mysql 慢查询
- mysql 查询慢分析
- mysql慢查询设置
- mysql 慢查询分析
- mysql 开启慢查询
- MYSQL - 慢查询日志
- MySQL慢查询
- mysql 慢查询
- MySQL开启慢查询
- mysql慢查询
- mysql慢查询设置
- Mysql 慢查询监听
- mysql 慢查询日志
- 开启Mysql 慢查询
- mysql 慢查询配置
- mysql慢查询
- Mysql 慢查询
- iOS疯狂详解之CocoaPods做iOS程序包的依赖管理
- Android学习之 清除缓存
- 树和二叉树
- InputAccessoryView
- 并行化资源池队列3——紧密相关的同步化队列
- mysql 慢查询
- My97DatePicker基本用法
- git简单使用
- 14分析2
- 第十六周项目3函数指针调用函数 吃饭睡觉打豆豆
- Android自定义对话框
- Android常用组件
- MatLab估算数据序列斜率
- mysql group by having用法+having where之间的区别+group by按日期分组统计的查询