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 -> Re: Index used in query?

Re: Index used in query?

From: <nandagopalj_at_hotmail.com>
Date: Mon, 02 Aug 1999 21:16:49 GMT
Message-ID: <7o51rm$87j$1@nnrp1.deja.com>


Hello:

You can force oracle to use indexes using hints. It would use partial indexes because not all the data for the composite index is available in your query. I assume you know how to use explain plans to determine the actual index used while processing.

Your select with hints looks like this:

> Select /*+ index(A) index(B) */
> From Table1 A, Table2 B
> Where (A.Field1 = B.Field1 )
> and ( A.Field2 = B.Field2 )
> and (B.FieldA = 1234 )

Hope this helps

Nan

> Table1
> Field1
> Field2
> Field3
> Index1 on Field1,Field2
>
> Table2
> FieldA
> Field1
> Field2
>
> Index2 on FieldA,Field1,Field2
>
> Query
> Select .....
> From Table1 A, Table2 B
> Where (A.Field1 = B.Field1 )
> and ( A.Field2 = B.Field2 )
> and (B.FieldA = 1234 )
>
> Thanks - Clive
>

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Mon Aug 02 1999 - 16:16:49 CDT

Original text of this message

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