Mysql自带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

转载于:https://my.oschina.net/linland/blog/306877

相关文章:

  • 2022-12-23
  • 2022-01-06
  • 2023-04-05
  • 2021-08-02
猜你喜欢
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2021-04-15
  • 2021-05-22
相关资源
相似解决方案