Re: LEFT JOINs not optimized away when not needed

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: LEFT JOINs not optimized away when not needed
Дата
Msg-id 709.1404852028@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: LEFT JOINs not optimized away when not needed  (Moshe Jacobson <moshe@neadwerx.com>)
Ответы Re: LEFT JOINs not optimized away when not needed  (Moshe Jacobson <moshe@neadwerx.com>)
Список pgsql-bugs
Moshe Jacobson <moshe@neadwerx.com> writes:
> On Tue, Jul 8, 2014 at 3:47 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> AFAICS, the eight
>> un-removed joins are either joining to non-unique keys, or can't be
>> removed because their tables are needed to provide joining columns for
>> un-removable joins.

> My point is that even if the column to which we are joining is a non-unique
> key, there should be no need to look at that table if the output does not
> include any values from that table, and there are no filters on that
> table's values, and all output columns are in the GROUP BY. Is the planner
> not smart enough to notice this?

No.  There is nothing about GROUP BY in the join removal logic.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Moshe Jacobson
Дата:
Сообщение: Re: LEFT JOINs not optimized away when not needed
Следующее
От: Moshe Jacobson
Дата:
Сообщение: Re: LEFT JOINs not optimized away when not needed