Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X4vjx-0004Zn-Ec for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Jul 2014 17:33:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X4vjw-0007Pv-UM for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Jul 2014 17:33:08 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X4vjv-0007Ne-RJ for pgsql-bugs@postgresql.org; Wed, 09 Jul 2014 17:33:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X4vjs-0001gt-Tt for pgsql-bugs@postgresql.org; Wed, 09 Jul 2014 17:33:05 +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 s69HX2BM018921; Wed, 9 Jul 2014 13:33:02 -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> <16398.1404924845@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Wed, 09 Jul 2014 13:30:39 -0400" Date: Wed, 09 Jul 2014 13:33:02 -0400 Message-ID: <18920.1404927182@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 Wed, Jul 9, 2014 at 12:54 PM, Tom Lane wrote: >> 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. > Oh... but that would only work if it were grouping without > aggregation, right? Seems awfully narrow. Right. Yeah, I was not that excited about its usefulness either. However, the OP seems to think that it's a common optimization (I wonder if he can cite chapter and verse on which other DBMSes do it). 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