请教大家关于mysql的Extra显示问题
请教大家一个关于mysql问题:
我创建了一个测试表:
CREATE TABLE `a` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`sex` tinyint(4) DEFAULT '0',
`name` varchar(20) DEFAULT NULL,
`birthday` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idx_name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=100001 DEFAULT CHARSET=utf8
然后,使用索引覆盖查询:
mysql> explain select id from a where name = '123';
+----+-------------+-------+------+---------------+----------+---------+-------+------+--------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+----------+---------+-------+------+--------------------------+
| 1 | SIMPLE | a | ref | idx_name | idx_name | 63 | const | 1 | Using where; Using index |
+----+-------------+-------+------+---------------+----------+---------+-------+------+--------------------------+
1 row in set (0.00 sec)
Using Where不就表示mysql服务器接收到存储引擎的数据,然后在服务器端进行过滤吗?为何在此sql中也会出现Using Where ? 我觉得存储引擎可以直接查找到满足条件的数据,并不需要在服务器端进行过滤后再返回给客户端。
在线等,如果问题解决,马上给分!谢谢 !