sample 1:
- select /*+INDEX(t IDX_SEL_ADD_DATE)*/ t.own_sys, count(1)
- from std_entp_login t
- where t.add_date >
- to_date('2010-12-28 00:00:00', 'yyyy-mm-dd hh24:mi:ss')
- and t.add_date <
- to_date('2010-12-28 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
- group by t.own_sys
用到别名时,/*+INDEX(TABLE INDEX_NAME)*/中的TABLE一定是别名,否则不走执行强制索引。
ref
http://www.cnblogs.com/ebs-blog/archive/2011/09/05/2167730.html