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

  oracle 索引,组合索引

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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
  • 2022-01-18
猜你喜欢
  • 2022-12-23
  • 2021-11-23
  • 2021-08-11
  • 2022-12-23
  • 2018-06-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案