Re: UNION vs UNION ALL
From: Grant Donohoe <donohoeg_at_syntegra.bt.co.uk>
Date: 1996/08/29
Message-ID: <32262D87.6A4E_at_syntegra.bt.co.uk>#1/1
Date: 1996/08/29
Message-ID: <32262D87.6A4E_at_syntegra.bt.co.uk>#1/1
Danny Roosens wrote:
>
> Hi,
>
> is it fair to say that one should use
>
> 'UNION ALL' as default
> and use 'UNION' only when duplicates are expected and not wanted
>
> because it's faster.
Yes. What happens I believe is that if you use UNION even when there are no duplicates it still spends time trying to filter them out, maybe even by building a temporary table.A redundant exercise in such a case.
Definitely quicker. We did it at Eurotunnel forn several years.
Grant Donohoe, syntegra u.k Received on Thu Aug 29 1996 - 00:00:00 CEST