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 13:33:02 -0400
Message-ID: <18920.1404927182@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoZSO7t+y3A4HF_tJ6cycQ2f0KUfOpEoMUfJM5DoHqO_3w@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>
	<16398.1404924845@sss.pgh.pa.us>
	<CA+TgmoZSO7t+y3A4HF_tJ6cycQ2f0KUfOpEoMUfJM5DoHqO_3w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Jul 9, 2014 at 12:54 PM, Tom Lane <tgl@sss.pgh.pa.us> 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



view thread (17+ messages)  latest in thread

Message-ID: <18920.1404927182@sss.pgh.pa.us>
Permalink:  ../18920.1404927182@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18920.1404927182@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: <18920.1404927182@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> <CA+TgmoZSO7t+y3A4HF_tJ6cycQ2f0KUfOpEoMUfJM5DoHqO_3w@mail.gmail.com> <18920.1404927182@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