很显然,用到了这个倒序索引 idx_rank1_desc,而这里的临时表等的信息消失了。
当然了,这里的组合比较多,比如我这张表的字段rank1,rank2两个可以任意组合,
(rank1 asc,rank2 asc);
(rank1 desc,rank2 desc);
(rank1 asc,rank2 desc);
(rank1 desc,rank2 asc);
我把这几个加上,
适合的查询比如
Select * from t1 where rank1 = 11 order by rank2;
Select * from t1 where 1 order by rank1,rank2;
Select * from t1 where 1 order by rank1 desc,rank2;
…
等等,我就不一一示范了。