Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Joins Optimization
try
select *
from (Select *
from table1,table2 where table1.field1 = table2.field1) t1where t1.field2 = 'test'
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'
>
> How an I get oracle to only search the
> joined resultset where field2 = 'test'.
>
> Meaning if table1 has 1000000 records and
> the joined resultset returns only 100 records
> I don't want the optimizer to query the text
> search ('test') on 1 million record but only
> on the joined resultset of 100 records.
>
> It seems to be always querying the 1 million record resultset
> before the join.
>
> Hope this makes sense.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Nov 27 2000 - 15:09:16 CST