Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id CE5191337B63 for ; Sun, 30 Jan 2011 18:43:11 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 89722-02 for ; Sun, 30 Jan 2011 22:43:04 +0000 (UTC) X-Greylist: delayed 00:07:53.113521 by SQLgrey-1.7.6 Received: from mail.anarazel.de (mail.anarazel.de [217.115.131.40]) by mail.postgresql.org (Postfix) with ESMTP id 94E971337B47 for ; Sun, 30 Jan 2011 18:43:04 -0400 (AST) Received: by mail.anarazel.de (Postfix, from userid 108) id 14623448004; Sun, 30 Jan 2011 23:35:09 +0100 (CET) Received: from anarazel.de (f053042026.adsl.alicedsl.de [78.53.42.26]) by mail.anarazel.de (Postfix) with ESMTPSA id 2FE17448004; Sun, 30 Jan 2011 23:35:05 +0100 (CET) Received: by anarazel.de (Postfix, from userid 1000) id 324BA1C013C; Sun, 30 Jan 2011 23:35:04 +0100 (CET) From: Andres Freund To: Tom Lane Subject: Re: postgres 9 query performance Date: Sun, 30 Jan 2011 23:35:03 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.38-rc2-andres-00175-g6fb1b30; KDE/4.5.1; x86_64; ; ) Cc: pgsql-performance@postgresql.org, yazan suleiman References: <201101282219.29777.andres@anarazel.de> <21572.1296425895@sss.pgh.pa.us> In-Reply-To: <21572.1296425895@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201101302335.03863.andres@anarazel.de> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/340 X-Sequence-Number: 42127 On Sunday 30 January 2011 23:18:15 Tom Lane wrote: > Andres Freund writes: > > What happens if you change the > > > > left join event.origin on event.id = origin.eventid > > > > into > > > > join event.origin on event.id = origin.eventid > > > > ? > > > > The EXISTS() requires that origin is not null anyway. (Not sure why the > > planner doesn't recognize that though). > > Sloppy thinking in reduce_outer_joins() is why. Wow. Nice one, thanks. Andres