MySQL命令解释忽略LIMIT吗? [英] MySQL command Explain ignore LIMIT?
本文介绍了MySQL命令解释忽略LIMIT吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是MySQL服务器版本5.5.14,现在我正在尝试使用Explain命令进行此简单的SQL查询:
I use MySQL server version 5.5.14 and now I am trying this simple SQL query with Explain command:
EXPLAIN SELECT id, name, thumb FROM `twitter_profiles` LIMIT 10;
它向我显示了此结果:
+----+-------------+-------+------+---------------+------+---------+------+-------+-------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+------+---------+------+-------+-------+
| 1 | SIMPLE | tp | ALL | NULL | NULL | NULL | NULL | 40823 | |
+----+-------------+-------+------+---------------+------+---------+------+-------+-------+
1 row in set (0.02 sec)
我的问题是为什么它扫描整个表而不是像我在LIMIT子句中指定的那样获取前10行?
My question is why it scans whole table instead of taking the first 10 rows as I specified in LIMIT clause?
推荐答案
查看全文