Re: union all vs. left outer join

From: VC <boston103_at_hotmail.com>
Date: Thu, 10 Nov 2005 18:03:14 -0500
Message-ID: <X8ydnfMFtY4zTO7eRVn-jw_at_comcast.com>


<henrik.sorensen_at_balcab.ch> wrote in message news:dl0iim$vi6$1_at_news.hispeed.ch...
[...]
>
> But thanks again for sharing your insight. I am a bit surprised that the
> indexes are not used as I expected, but then again, I learned something.
>
> Henrik
>
>

If you access a set of rows via an index, you need two logical IOs per each access, one to read an index entry and another to read the row the index entry points to, while with a full scan you read table rows directly using efficient multiblock reads. So it's a matter of deciding what is cheaper in terms of CPU and IO, and the optimizer does just that. The table access algorithms are more complicated of course but that's the general idea. Received on Fri Nov 11 2005 - 00:03:14 CET

Original text of this message