CREATE TABLE `a` ( `id` int(10) unsigned NOT NULL, `b` int(10) unsigned NOT NULL, `c` int(10) unsigned NOT NULL, PRIMARY KEY (`id`,`b`,`c`), KEY `index_1` (`b`), KEY `index_2` (`b`,`c`) ); insert into a (id,b,c) values(1,7161,0); insert into a (id,b,c) values(2,7161,0); insert into a (id,b,c) values(3,7161,2); insert into a (id,b,c) values(4,7131,0); insert into a (id,b,c) values(5,7121,1); --vertical_results explain select id from a where b=7161 and c=0 and id >=1 and id <=9405 order by id; explain select id from a where b=7161 and c=0 and id >=1 and id <=9405;