【发布时间】:2015-01-12 08:19:25
【问题描述】:
我使用EXPLAIN 运行以下查询
EXPLAIN SELECT form.id AS `Reference No.`,
department.name AS `Department`,
section.name AS `Section`
FROM form
JOIN department
ON form.deptid = department.id
JOIN section
ON form.sectid = section.id
在第一行输入ALL 是否表示会出现性能问题?
+----+-------------+------------+--------+---------------+---------+---------+----------------------+------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows |
+----+-------------+------------+--------+---------------+---------+---------+----------------------+------+
| 1 | SIMPLE | form | ALL | deptid,sectid | | | | 779 |
| 1 | SIMPLE | department | eq_ref | PRIMARY | PRIMARY | 4 | wfs-test.form.deptid | 1 |
| 1 | SIMPLE | section | eq_ref | PRIMARY | PRIMARY | 4 | wfs-test.form.sectid | 1 |
+----+-------------+------------+--------+---------------+---------+---------+----------------------+------+
【问题讨论】:
-
查看此链接。对这个话题有很好的解释..khaidoan.wikidot.com/mysql-using-explain