using where: 表示存储引擎搜到记录后进行了后过滤(POST-FILTER),如果查询未能使用索引,using where的作用只是提醒我们mysql要用where条件过滤结果集
- mysql> explain select * from test where id > 1;
- +----+-------------+-------+-------+---------------+---------+---------+------+-------+-------------+
- | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
- +----+-------------+-------+-------+---------------+---------+---------+------+-------+-------------+
- | 1 | SIMPLE | test | range | PRIMARY | PRIMARY | 8 | NULL | 34252 | Using where |
- +----+-------------+-------+-------+---------------+---------+---------+------+-------+-------------+
using temporary 表示mysql需要使用临时表来存储结果集,常见于排序和分组查询
- mysql> explain select * from test where id in (1,2) group by bnet_id;
- +----+-------------+-------+-------+-----------------------------------------+---------+---------+------+------+----------------------------------------------+
- | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
- +----+-------------+-------+-------+-----------------------------------------+---------+---------+------+------+----------------------------------------------+
- | 1 | SIMPLE | test | range | PRIMARY,IDX(event_key-bnet_Id),idx_bnet | PRIMARY | 8 | NULL | 2 | Using where; Using temporary; Using filesort |
- +----+-------------+-------+-------+-----------------------------------------+---------+---------+------+------+----------------------------------------------+
(编辑:西安站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|