mysql教程

超轻量级php框架startmvc

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

更新时间:2020-04-23 13:05:01 作者:startmvc
1.showvariableslike'%profiling%';(查看profiling信息)     2.setprofiling=1;(开启profilin
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 
profiling 性能分析