Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

does LEFT OUTER JOIN use indexes

569662Nov 6 2008 — edited Nov 6 2008
Hi, I have a Query that uses 2 tables, i have to join them using left outer join but i notice in the explain plan that Oracle doesn't use any index defined for theses tables, an extract of my query is:

SELECT
ROWNUM
,HEN.histo
,SGS.cod_cent
,HEN.pred
,HEN.pred_kin
,HEN.account
FROM direc_hom SGS
LEFT OUTER JOIN direc_cli HEN
ON (HEN.dir_est=SGS.dir_estand
AND HEN.Depto=SGS.cod_depto
AND HEN.Cod_cit=SGS.codigo_cit)


i have an index in each table using the 3 field of the join (i.e index for DIREC_CLI (dir_est,Depto,Cod_cit))

Why Oracla does full scan to poth tables and doesn't use the indexes?..Is it the optimizer deciding it is faster to make a full scan according to data even if the tables are relatively big?.

Each table has 5 million of record aprox.
I have Oracle 10.2.0.3.


Thanks..
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 4 2008
Added on Nov 6 2008
2 comments
4,156 views