select /*+ first_rows(20) */ * from t where id<20 --分页
select /*+ all_rows */ * from t where id<20 --OLAP
select /*+ index(t t_ind) */ * from t where object_id>1 --索引 index range scan
select /*+ index_combine(t t_bm) */ * from t --位图索引 bitmap index full scan
select /*+ index_ffs(t t_ind) */ object_id from t where object_id<100 --index fast full scan
select /*+ index_ss(t ind_t) */ * from t where object_name='test' --index skip scan
当两个表都比较大时,hasp join的效率要高于嵌套循环(nested loops)的关联方式
select /*+ use_hash(t1,t) */ t.* from t1,t where t1.object_id=t.object_id
nested loops适用的场合是当一个关联表比较小的时候,效率会更高
select /*+ use_nl(t1,t) */ t.* from t1,t where t1.object_id=t.object_id