Maison  >  Article  >  base de données  >  Mysql自带profiling性能分析工具_MySQL

Mysql自带profiling性能分析工具_MySQL

WBOY
WBOYoriginal
2016-06-01 13:38:44988parcourir

bitsCN.com


Mysql自带profiling性能分析工具

 

1. show variables like '%profiling%';(查看profiling信息)    


Mysql自带profiling性能分析工具_MySQL
 

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


Mysql自带profiling性能分析工具_MySQL
 

3. 执行SQL查询 

例:select goods_name from ecs_goods where goods_id

 

show  profiles;


Mysql自带profiling性能分析工具_MySQL

 

4. show profile for query 4;


Mysql自带profiling性能分析工具_MySQL
 

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
 

bitsCN.com
Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn