MySQL Profiling--常用命令

## 查看PROFILING是否开启
SELECT @@profiling;


## 开始会话级别PROFILING
SET profiling=1;

## 执行要检查的SQL

## 查看捕获的所有SQL
SHOW PROFILES;

## 看看特定SQL的执行信息
SHOW PROFILE CPU,BLOCK IO,SWAPS FOR QUERY 1;


##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

 

posted @ 2019-03-07 21:40  TeyGao  阅读(162)  评论(0编辑  收藏  举报