--source include/have_innodb.inc CREATE TABLE `t1` ( `id` int(11) NOT NULL AUTO_INCREMENT, `b` int(11) DEFAULT NULL, `c` int(11) DEFAULT NULL, `orderby` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `orderby` (`orderby`) ) ENGINE=MyISAM ; insert into t1 (b,c,orderby) values (rand()*100, rand()*100, rand()*200); insert into t1 (b,c,orderby) select rand()*100, rand()*100, rand()*200 from t1; insert into t1 (b,c,orderby) select rand()*100, rand()*100, rand()*200 from t1; insert into t1 (b,c,orderby) select rand()*100, rand()*100, rand()*200 from t1; insert into t1 (b,c,orderby) select rand()*100, rand()*100, rand()*200 from t1; insert into t1 (b,c,orderby) values(1,1,1); insert into t1 (b,c,orderby) values(2,1,1); insert into t1 (b,c,orderby) values(3,1,2); insert into t1 (b,c,orderby) values(4,1,2); --vertical_results explain extended select * from t1 order by orderby; explain extended select * from t1 order by id; alter table t1 engine=innodb; explain extended select * from t1 order by orderby; explain extended select * from t1 order by id;