Re: What to index to speed up my UNION views?

From: Ashley Moran <work(at)ashleymoran(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: What to index to speed up my UNION views?
Date: 2006-03-28 08:45:02
Message-ID: 200603280945.02978.work@ashleymoran.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday 27 March 2006 12:13, Martijn van Oosterhout wrote:
> You're using UNION rather than UNION ALL where. There's a big
> difference and I imagine you actually want the latter. It also makes a
> big difference in query optimisation.
>
> If that doesn't fix it, come back with the EXPLAIN ANALYZE output of
> your query.
>
> Have a nice day,

Thanks Martin

It turned out that the query being used was wrong anyway (pulling through too
much data). When it was fixed it sped up greatly. I've searched on the
Postgres docs and can't find an explanation of UNION ALL. How does it differ
from UNION?

Ashley

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-03-28 09:05:16 Re: What to index to speed up my UNION views?
Previous Message Ashley Moran 2006-03-28 08:43:05 Re: What to index to speed up my UNION views?