Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Index used in query?
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