Re: LEFT JOINs not optimized away when not needed - Mailing list pgsql-bugs

From Moshe Jacobson
Subject Re: LEFT JOINs not optimized away when not needed
Date
Msg-id CAJ4CxLkWyRASRNOZLcsgKP=aZ+T7xsaZ-MnWBfD9Zzh_YThs4w@mail.gmail.com
Whole thread Raw
In response to Re: LEFT JOINs not optimized away when not needed  (Moshe Jacobson <moshe@neadwerx.com>)
List pgsql-bugs
On Thu, Jul 10, 2014 at 12:12 PM, Moshe Jacobson <moshe@neadwerx.com> wrote=
:

> It's reasonable to hope that if the aggregated column isn't selected,
>> the join will get removed, but cars (person_id) is not unique.
>>
>
> Exactly. But the same should be true even if c.plate_number is not
> aggregated in the view def.
> As long as it's not selected, the output should list one row per person_i=
d
> and the cars table should be removed from the join.
> What I've just described is our most common use case.
>

Oops, what I said may not have been clear.
The view def wouldn't have a GROUP BY in most of our use cases.
The GROUP BY would actually be used to group all of the columns selected
from the view.


Moshe Jacobson
Manager of Systems Engineering, Nead Werx Inc. <http://www.neadwerx.com>
2323 Cumberland Parkway =C2=B7 Suite 201 =C2=B7 Atlanta, GA 30339

"Quality is not an act, it is a habit." -- Aristotle

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Compile fails on AIX 6.1
Next
From: Michael Paquier
Date:
Subject: Re: Missing file versions for a bunch of dll/exe files in Windows builds