1. SQL执行顺序
FROM > ON > JOIN > WHERE > GROUP BY > HAVING > SELECT > DISTINCT > ORDER BY > LIMIT
2. SQL执行效率
EXPLAIN SELECT * from user_info WHERE id < 300;
主要查看指标 type
ALL < index < range ~ index_merge < ref < eq_ref < const < system
FROM > ON > JOIN > WHERE > GROUP BY > HAVING > SELECT > DISTINCT > ORDER BY > LIMIT
EXPLAIN SELECT * from user_info WHERE id < 300;
主要查看指标 type
ALL < index < range ~ index_merge < ref < eq_ref < const < system
本文标题:MySQL
本文链接:https://www.haomeiwen.com/subject/mxmsoftx.html
网友评论