Re: LEFT JOINs not optimized away when not needed

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Moshe Jacobson <moshe(at)neadwerx(dot)com>, Postgres-Bugs <pgsql-bugs(at)postgresql(dot)org>, Robert Mowlavi <robert(at)neadwerx(dot)com>, Chris Autry <chris(at)neadwerx(dot)com>
Subject: Re: LEFT JOINs not optimized away when not needed
Date: 2014-07-09 17:33:02
Message-ID: 18920.1404927182@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Moshe Jacobson 2014-07-09 17:37:25 Re: LEFT JOINs not optimized away when not needed
Previous Message Robert Haas 2014-07-09 17:30:39 Re: LEFT JOINs not optimized away when not needed

Browse pgsql-hackers by date

  From Date Subject
Next Message Moshe Jacobson 2014-07-09 17:37:25 Re: LEFT JOINs not optimized away when not needed
Previous Message Sawada Masahiko 2014-07-09 17:32:35 Re: add line number as prompt option to psql