employee
employee_orgn:联合主键(employee_id,orgn_id),索引1:employee_id,索引2:orgn_id
orgn
explain SELECT DISTINCT e.*FROM employee e LEFT JOIN employee_orgn eo ON eo.employee_id = e.id LEFT JOIN orgn o ON o.id = eo.orgn_idWHERE e.state != 'deleted' AND e.state != 'hidden' AND (o.state != 'hidden' OR o.state IS NULL)ORDER BY e.id DESC
Q:
这里join联查,mysql嵌套循环查询了10的8次方的数量级吗?
为什么有临时表,和排序为什么是文件排序
为什么第二行是覆盖索引
希望讲解一下这个explain结果,优化分析
感激不尽呀~
炎炎设计
相关分类