索引引用不到(求高手赐教)
create table aa(
aa_date date,
aa_server int(2),
key aa_date(date)
);
insert into aa('2011-11-03',0);
查询
explain select * from aa where aa_date>=?;
或者
explain select * from aa where aa_date<=?;
后面的查询离职检索出的列超过一定数量就不会引用索引了,>=超过230就不会引用索引了,type是all,后面的说明也没有用到索引
而写成
explain select date from aa where aa_date<=?;
又可以引用到,怎么样在查询全部字段的情况下用到索引。
求高手解释并赐教谢谢