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
本文深入探讨了SQL查询性能优化的关键方法之一——Profiling技术,通过展示具体SQL语句的执行过程,帮助开发者识别性能瓶颈并进行优化。
320

被折叠的 条评论
为什么被折叠?



