I have a requirement in which i have to force the sql not to use a particular index which exists on a table.
for example,
create table t1(id varhcar2(10),data1 varchar2(3000));
create table t2(id varhcar2(10),data2 varchar2(3000));
create index id1 on t1(id);
select * from t1,t2 where t1.id=t2.id;
I cannot drop the index id1 and neither drop it as i dont have rights on it. therefore i want to add some kind of hint to avoid using it..
Is there any such hint, or is there any workaround for this.
Thanks in advance
use NO_INDEX hint
http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements006.htm#BABHJBIB
for instance
SELECT /*+ NO_INDEX(t1 id1) */
FROM t1,
t2
WHERE t1.id = t2.id;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With