oracle hint

 

sample 1:

  1.   
[sql] view plain copy
 
  1. select /*+INDEX(t IDX_SEL_ADD_DATE)*/ t.own_sys, count(1)  
  2.  from std_entp_login t  
  3. where t.add_date >  
  4.               to_date('2010-12-28 00:00:00', 'yyyy-mm-dd hh24:mi:ss')  
  5.           and t.add_date <  
  6.               to_date('2010-12-28 23:59:59', 'yyyy-mm-dd hh24:mi:ss')  
  7. group by t.own_sys  

 


用到别名时,/*+INDEX(TABLE INDEX_NAME)*/中的TABLE一定是别名,否则不走执行强制索引。

 

 

ref

http://www.cnblogs.com/ebs-blog/archive/2011/09/05/2167730.html

posted @ 2018-01-22 11:40  feiyun8616  阅读(149)  评论(0编辑  收藏  举报