?
我们可以开启 profiling, 让 MySQL 为我们记录 SQL 语句的执行流程
?
查看 profiling 参数
shell> select @@profiling;
进行更改
shell> set profiling = 1;
执行语句
select * from employees limit 100;
查看该语句执行流程
show profile;
分别是
启动
权限检查
打开表
初始化表
锁系统
优化查询
统计
优化
执行
发送数据
结束
查询结束
关闭表
释放
清理
?
请注意上述命令与下面的不同
show profiles;
显示完成每条指令的所花费的时间
?
来源: http://www.bubuko.com/infodetail-3605447.html