Re: optimising UNION performance

From: Ragnar <gnari(at)hive(dot)is>
To: Rafal Pietrak <rafal(at)zorro(dot)isa-geek(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: optimising UNION performance
Date: 2006-08-28 09:11:44
Message-ID: 1156756304.26837.106.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On mán, 2006-08-28 at 10:23 +0200, Rafal Pietrak wrote:
> Hi all,
>
> Is there a way to speed up the query to my 'grand total' logfile,
> constructed as a UNION of smaller (specialised) logfiles?
>

I do not know if this is relevant to your case, but
possibly you can use a UNION ALL instead of a UNION.

In many cases the UNION ALL gives petter performance,
as the unique step can be skipped, as well as a sort
needed by the unique.

gnari

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rafal Pietrak 2006-08-28 09:51:52 Re: optimising UNION performance
Previous Message Alban Hertroys 2006-08-28 08:56:39 Re: speeding up big query lookup