性能分析
explain select ...
总共有这些个字段
性能分析字段
-
select_type 字段详解
image.png
实例:
explain SELECT * from t_user UNION select * from t_user
EXPLAIN select * from employee where dept_id in (select id from dept union select id from dept);
-
type
image.png
查询性能从最好到最差的排序是:
System>const>eq_ref>range>index>All
-
extra
image.png -
索引优化
网友评论