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 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM