- employee
- employee_orgn: federated primary key (employee_id,orgn_id), index 1, 2:orgn_id employees, index
- 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_id
WHERE
e.state != "deleted"
AND e.state != "hidden"
AND (o.state != "hidden" OR o.state IS NULL)
ORDER BY e.id DESC
< H2 > explain: < / H2 >
Q:
- here join joint search, mysql nested loop query to the order of magnitude of 10 to the 8th?
- Why is there a temporary table, and why the sorting is file sorting
- Why is the second row an override index
- would like to explain the explain result and optimize the analysis
Thank you very much ~