你好我有这个查询
SELECT * FROM customers WHERE height > 180 AND height < 200
这是explain
应用于它的结果:
mysql> explain SELECT * FROM customers WHERE height > 180 AND height < 200;
+----+-------------+-----------+------+---------------+------+---------+------+-------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-----------+------+---------------+------+---------+------+-------+-------------+
| 1 | SIMPLE | customers | ALL | height | NULL | NULL | NULL | 10423 | Using where |
+----+-------------+-----------+------+---------------+------+---------+------+-------+-------------+
请注意,该字段有一个索引height
没有被拾取,不知何故......
该height
字段是一个整数。我不知道。我期待它被使用,type
也是range
任何人?