Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Outer joins = full scan?
Billy Verreynne wrote:
> Ed Prochak wrote:
>
>
>
>>Why do you want to use an index on the outer join query?? >> >>Think about what an OUTER JOIN is requesting the DB to do: return ALL rows >>of the base table (T), matched or not with the rows of the outer table >>(C). >> >> What is the fastest way to get all the rows of the table? >> >>A) access the index and then access the table >>B) access just the table >> >>Answer B is faster for accessing all rows of the table.
>> AND t.location_code = 'value' >> AND t.case_num = 'value';
True, I overlooked that. It does explain why the optimizer chose a full scan though. (The cardinality of the outer join query was 37thousand.)
So as another poster pointed out, are those attributes usable for the index he wants to use. If they are, a suitable hint might move the CBO to go the other way.
Thanks for the sanity check.
-- Ed Prochak running http://www.faqs.org/faqs/running-faq/ netiquette http://www.psg.com/emily.html -- "Two roads diverged in a wood and I I took the one less travelled by and that has made all the difference." robert frostReceived on Fri May 30 2003 - 12:13:27 CDT
![]() |
![]() |