Mysql自带profiling性能分析工具使用分享
程序员文章站
2023-12-20 18:10:10
1. show variables like '%profiling%';(查看profiling信息)
...
1. show variables like '%profiling%';(查看profiling信息)
2. set profiling=1;(开启profiling)
3. 执行sql查询
例:select goods_name from ecs_goods where goods_id <5000;
show profiles;
4. show profile for query 4;
show profile 的格式如下:
show profile [type [, type] ... ]
[for query n]
[limit row_count [offset offset]]
type:
all
| block io
| context switches
| cpu
| ipc
| memory
| page faults
| source
| swaps