pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Moshe Jacobson <moshe@neadwerx.com>
Cc: Postgres-Bugs <pgsql-bugs@postgresql.org>
Cc: Robert Mowlavi <robert@neadwerx.com>
Cc: Chris Autry <chris@neadwerx.com>
Subject: Re: LEFT JOINs not optimized away when not needed
Date: Wed, 09 Jul 2014 12:54:05 -0400
Message-ID: <16398.1404924845@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoZ8HGpVjmnGv=UHd59b3N8KCpo-_yo1D7-GRxT8aaFsfg@mail.gmail.com>
References: <CAJ4CxLkrWctbEhoshWvxnEDi9=PvoDbWzdf5OJqvfv840Hv0_Q@mail.gmail.com>
	<8401.1404832771@sss.pgh.pa.us>
	<CAJ4CxLnRUjVAsj+KuWzDtRotsuR7tjRqsAmtsEaL1vwSqQRkog@mail.gmail.com>
	<30516.1404848833@sss.pgh.pa.us>
	<CAJ4CxLnPdAJ9aHTe65TLBN1X2Xdb3g1Q0-hKt2g7+1VNadGWDw@mail.gmail.com>
	<709.1404852028@sss.pgh.pa.us>
	<CAJ4CxLkYMm6wV-5yhGtRVXOHsP-9CkXafhsT=+2D6-9dkMueiA@mail.gmail.com>
	<2517.1404855600@sss.pgh.pa.us>
	<CA+TgmoZ8HGpVjmnGv=UHd59b3N8KCpo-_yo1D7-GRxT8aaFsfg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, Jul 8, 2014 at 5:40 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Moshe Jacobson <moshe@neadwerx.com> writes:
>>> On Tue, Jul 8, 2014 at 4:40 PM, Tom Lane <tgl@sss.pgh.pa.us> 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



view thread (17+ messages)  latest in thread

Message-ID: <16398.1404924845@sss.pgh.pa.us>
Permalink:  ../16398.1404924845@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16398.1404924845@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, moshe@neadwerx.com, robert@neadwerx.com, chris@neadwerx.com
  Subject: Re: LEFT JOINs not optimized away when not needed
  In-Reply-To: <16398.1404924845@sss.pgh.pa.us>
  References: <CAJ4CxLkrWctbEhoshWvxnEDi9=PvoDbWzdf5OJqvfv840Hv0_Q@mail.gmail.com> <8401.1404832771@sss.pgh.pa.us> <CAJ4CxLnRUjVAsj+KuWzDtRotsuR7tjRqsAmtsEaL1vwSqQRkog@mail.gmail.com> <30516.1404848833@sss.pgh.pa.us> <CAJ4CxLnPdAJ9aHTe65TLBN1X2Xdb3g1Q0-hKt2g7+1VNadGWDw@mail.gmail.com> <709.1404852028@sss.pgh.pa.us> <CAJ4CxLkYMm6wV-5yhGtRVXOHsP-9CkXafhsT=+2D6-9dkMueiA@mail.gmail.com> <2517.1404855600@sss.pgh.pa.us> <CA+TgmoZ8HGpVjmnGv=UHd59b3N8KCpo-_yo1D7-GRxT8aaFsfg@mail.gmail.com> <16398.1404924845@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox