Query on the performance of JOIN on indexed columns [message #548590] |
Fri, 23 March 2012 05:44  |
 |
orapratap
Messages: 134 Registered: November 2011 Location: Canada
|
Senior Member |
|
|
Hello
Suppose
I have 2 tables with huge data and composite unique indexes on the joining columns
create unique index a_i on a(c1,c2);
create unique index b_i on b(c1,c2);
Now in the query I am joining all indexed columns of both tables
select * from a,b
where a.c1 = b.c1
and a.c2 = b.c2
and a.c3 = <some value> --- this has poor selectivity
Sometime I have seen both tables were accessed using index access
Such queries executed better only when I tried /*+ full(a) parallel(a) */ on the larger table and let other table use index access
and this was Nested loop
This worked sometimes
I am not sure if I should use HASH by doing b also as parallel (using hint)
The question is how do I weigh FTS w.r.t Index access in similar situations where joining columns have unique index but since the filtering condition is poor lot of data needs to be handled?
Unfortunately tkprof is not available in this situation
and I assume referring COST in the plan displayed in GUI tools won't be a good starting point
Thanks and Regards
OraPratap
P.S. this being a general query I am unable to attach a plan etc.
[Updated on: Fri, 23 March 2012 05:47] Report message to a moderator
|
|
|
|
|
|
|