美文网首页
Mysql基础调优

Mysql基础调优

作者: hcq0514 | 来源:发表于2020-03-11 14:47 被阅读0次

性能分析

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
  • 索引优化


相关文章

网友评论

      本文标题:Mysql基础调优

      本文链接:https://www.haomeiwen.com/subject/ieccjhtx.html