首页 > 数据库 > MySQL > 正文

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

2020-01-18 23:56:49
字体:
来源:转载
供稿:网友
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 
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表