Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X4v8M-00028M-2Z for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Jul 2014 16:54:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X4v8L-0001Jl-E5 for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Jul 2014 16:54:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X4v8J-0001HW-Qw for pgsql-bugs@postgresql.org; Wed, 09 Jul 2014 16:54:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X4v8C-0002DF-Qa for pgsql-bugs@postgresql.org; Wed, 09 Jul 2014 16:54:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s69Gs5va016399; Wed, 9 Jul 2014 12:54:05 -0400 From: Tom Lane To: Robert Haas cc: Moshe Jacobson , Postgres-Bugs , Robert Mowlavi , Chris Autry Subject: Re: LEFT JOINs not optimized away when not needed In-reply-to: References: <8401.1404832771@sss.pgh.pa.us> <30516.1404848833@sss.pgh.pa.us> <709.1404852028@sss.pgh.pa.us> <2517.1404855600@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Wed, 09 Jul 2014 12:07:35 -0400" Date: Wed, 09 Jul 2014 12:54:05 -0400 Message-ID: <16398.1404924845@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Robert Haas writes: > On Tue, Jul 8, 2014 at 5:40 PM, Tom Lane wrote: >> Moshe Jacobson writes: >>> On Tue, Jul 8, 2014 at 4:40 PM, Tom Lane wrote: >>>> No. There is nothing about GROUP BY in the join removal logic. >>> OK. Thank you. Is this something that would make sense to add? >> Dunno. I don't recall any previous requests for such a thing, so I'd not >> be inclined to add it unless it can be done very cheaply (in terms of both >> code and runtime). > I thought this was exactly what was being discussed on the "Allowing > join removals for more join types" thread. No, this is a completely different thing. The idea is that if the query is grouping on outer-relation columns, you don't need to care if the inner relation is unique or not, because it doesn't matter if there are multiple matches. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs