Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 1700B1337B34 for ; Sat, 11 Dec 2010 09:46:22 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 48066-07 for ; Sat, 11 Dec 2010 13:46:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from vs137086.vserver.de (static-ip-62-75-137-86.inaddr.intergenia.de [62.75.137.86]) by mail.postgresql.org (Postfix) with ESMTP id 28D2A1336B42 for ; Sat, 11 Dec 2010 09:46:13 -0400 (AST) Received: (qmail 9861 invoked from network); 11 Dec 2010 14:45:47 +0100 Received: from p57aad585.dip.t-dialin.net (HELO a-kretschmer.de) (87.170.213.133) by static-ip-62-75-137-86.inaddr.intergenia.de with (AES256-SHA encrypted) SMTP; 11 Dec 2010 14:45:47 +0100 Received: from kretschmer by a-kretschmer.de with local (Exim 4.69) (envelope-from ) id 1PRPlj-0003In-K8 for pgsql-performance@postgresql.org; Sat, 11 Dec 2010 14:45:47 +0100 Date: Sat, 11 Dec 2010 14:45:47 +0100 From: Andreas Kretschmer To: pgsql-performance@postgresql.org Subject: Re: UNION and bad performance Message-ID: <20101211134547.GB12385@tux> References: <4D00B4DE.3030508@xgs-france.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-GPG-Fingerprint: EE16 3C01 7B9C 10F7 2C8B 3B86 4DB3 D9EE 7F45 84DA X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! X-Lugdd: Gerd Kube X-Info: My name is root. Just root. And I am licensed to kill -9 User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201012/157 X-Sequence-Number: 41609 Marc Mamin 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°