Re: union all vs. left outer join

From: VC <boston103_at_hotmail.com>
Date: Mon, 7 Nov 2005 19:41:19 -0500
Message-ID: <1PmdnSR9R-6yafLeRVn-vg_at_comcast.com>


<henrik.sorensen_at_balcab.ch> wrote in message news:dkoitg$upp$2_at_news.hispeed.ch...
> vc wrote:
>
>>
>> henrik.sorensen_at_balcab.ch wrote:
>>> Warning long mail ...
>>>
>>> For several days I have tried to figure out why two sql with an union
>>> all
>>> is much faster than using a single sql with left outer join.
>>
>>
>> What do you mean much faster ? In Oracle, both queries execute in
>> approximately the same time ~15-16 msec.
> Sorry for not being more precise.
> The queries with the provided test data does of course not present any
> serious database engine with any problems.
>
> The test case is reduced from a production system where each table have
> 200'000 records, and hence the materialization of the tables A-B-C is
> performing very very badly.

You need to put together a reproducible test case which would demonstrate that the first query is indeed slower than the second. What you've posted does not show that.

>
>>
>>
>>> Henrik
>
Received on Tue Nov 08 2005 - 01:41:19 CET

Original text of this message