欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Mysql自带profiling性能分析工具使用分享

程序员文章站 2023-12-20 18:10:10
1. show variables like '%profiling%';(查看profiling信息)      ...
1. show variables like '%profiling%';(查看profiling信息)    

Mysql自带profiling性能分析工具使用分享
 
2. set profiling=1;(开启profiling)

Mysql自带profiling性能分析工具使用分享
 
3. 执行sql查询 
例:select goods_name from ecs_goods where goods_id <5000;
 
show  profiles;

Mysql自带profiling性能分析工具使用分享
 
4. show profile for query 4;

Mysql自带profiling性能分析工具使用分享
 
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 

上一篇:

下一篇: