Mysql自帶profiling機能剖析對象應用分享。本站提示廣大學習愛好者:(Mysql自帶profiling機能剖析對象應用分享)文章只能為提供參考,不一定能成為您想要的結果。以下是Mysql自帶profiling機能剖析對象應用分享正文
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