Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Joins Optimization
In article <8vuhmg$ooe$1_at_nnrp2.deja.com>,
geenstones_at_my-deja.com wrote:
> Given the followin SQL statement:
>
> Select * from table1,table2
> where table1.field1(pk) = table2.field1(fk)
> and table1.field2 = 'test'
>
To ensure the desired execution path you could add hints. To make table1 the driving table try using an ordered hint:
Select /*+ ORDERED */ *
from table1,table2
where table1.field1(pk) = table2.field1(fk)
and table1.field2 = 'test'
Also, you could try adding an index hint to enforce the use of an index on field2:
Select /*+ INDEX(table1 <field2index>) */ *
from table1,table2
where table1.field1(pk) = table2.field1(fk)
and table1.field2 = 'test'
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Nov 27 2000 - 16:03:13 CST