oracle 索引,组合索引

1. 组合索引   

   id,code      组合

   id,number  组合

2. 排序cost

    使用 id ,cost=0

    使用 id+code  cost=0

    使用 id+number  cost=6

    使用 code   cost=125

    使用 number cost=125

    使用 id          cost=0

--select b.*,rownum rn from t_order b order by b.id desc;--0,0,0
--select b.*,rownum rn from t_order b order by b.id desc,b.number desc;  --6 6 1
--select b.*,rownum rn from t_order b order by b.id desc,b.code desc; --0,0,0
select b.*,rownum rn from t_order b order by b.number desc; --125,125,3

  

3.关于执行计划 http://www.cnblogs.com/liuyongcn/p/3553337.html

原文地址:https://www.cnblogs.com/an5211/p/6756474.html