Skip site navigation (1) Skip section navigation (2)

Re: UNION and bad performance

From: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: UNION and bad performance
Date: 2010-12-11 13:45:47
Message-ID: 20101211134547.GB12385@tux (view raw or flat)
Thread:
Lists: pgsql-performance
Marc Mamin <M(dot)Mamin(at)intershop(dot)de> wrote:

> Hello,
> 
>  
> 
> UNION will remove all duplicates, so that the result additionally requires to
> be sorted.

Right, to avoid the SORT and UNIQUE - operation you can use UNION ALL


> 
> Anyway,  for performance issues, you should always start investigation with
> explain analyze .

ACK.

    Arguments to support bottom-posting...

    A: Because we read from top to bottom, left to right.
    Q: Why should I start my reply below the quoted text?

    A: Because it messes up the order in which people normally read text.
    Q: Why is top-posting such a bad thing?

    A: The lost context.
    Q: What makes top-posted replies harder to read than bottom-posted?

    A: Yes.
    Q: Should I trim down the quoted part of an email to which I'm replying?




Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

In response to

pgsql-performance by date

Next:From: pasman pasmańskiDate: 2010-12-12 13:12:59
Subject: Re: UNION and bad performance
Previous:From: Marc MaminDate: 2010-12-11 10:27:59
Subject: Re: UNION and bad performance

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group