Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Possible to force an index UNIQUE SCAN in a join ??

Possible to force an index UNIQUE SCAN in a join ??

From: Spendius <spendius_at_muchomail.com>
Date: 22 Aug 2005 05:58:17 -0700
Message-ID: <1124715497.844803.264930@g47g2000cwa.googlegroups.com>


Hi,
Is it possible to get Oracle to join 2 tables (in a nested loop for instance) but using at the same time an index UNIQUE SCAN ? Or will it always use a FAST SCAN in a join (and the unique scan is only possible with a value given in the predicate) ?
What I'm trying to reach is the following:
>loop on table 1
> for each id retrieved
> look it up in table 2 using UNIQUE SCAN
> return value of field2 from this table
> end for
>end loop

Of course an index declared unique exists on table 2.

When I hint with INDEX(<table alias> <ind. name>) my explain plan always shows a FAST SCAN, whose cost is 900 000 times higher than a UNIQUE one (both tables contains about 20 millions of rows, an FTS has to be performed on the first one). I'm in 8.1.7.4.

Thanks.
Regards,
Spendius Received on Mon Aug 22 2005 - 07:58:17 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US