goback add

Mysql自带profiling性能分析工具

3177 点击·0 回帖
灯火互联
楼主
 
Mysql自带profiling性能分析工具
 
1. show variables like '%profiling%';(查看profiling信息)

图片:20121110113606224.jpg


 
2. set profiling=1;(开启profiling)
 

图片:20121110113606673.jpg


 
3. 执行SQL查询
例:select goods_name from ecs_goods where goods_id <5000;
 
show profiles;
 

图片:20121110113607190.jpg


 
4. show profile for query 4;
 

图片:20121110113607499.jpg


 
show profile 的格式如下:
SHOW PROFILE [type [, type] ... ]
     [FOR QUERYn]
     [LIMITrow_count [OFFSET offset]]
 
type:
     ALL
| BLOCK IO
| CONTEXT SWITCHES
| cpu
| IPC
| MEMORY
| PAGE FAULTS
| SOURCE
| SWAPS
 

喜欢0 评分0