Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 4A3881337B7E for ; Sun, 30 Jan 2011 18:22:57 -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 36564-07 for ; Sun, 30 Jan 2011 22:22:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 8587A1337B63 for ; Sun, 30 Jan 2011 18:22:49 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p0UMIFAL021573; Sun, 30 Jan 2011 17:18:16 -0500 (EST) To: Andres Freund cc: pgsql-performance@postgresql.org, yazan suleiman Subject: Re: postgres 9 query performance In-reply-to: <201101282219.29777.andres@anarazel.de> References: <201101282219.29777.andres@anarazel.de> Comments: In-reply-to Andres Freund message dated "Fri, 28 Jan 2011 22:19:29 +0100" Date: Sun, 30 Jan 2011 17:18:15 -0500 Message-ID: <21572.1296425895@sss.pgh.pa.us> From: Tom Lane 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/338 X-Sequence-Number: 42125 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. Fixed now: http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=1df57f63f3f60c684aa8918910ac410e9c780713 regards, tom lane