Re: LEFT JOINs not optimized away when not needed

Поиск
Список
Период
Сортировка
От Moshe Jacobson
Тема Re: LEFT JOINs not optimized away when not needed
Дата
Msg-id CAJ4CxLnRUjVAsj+KuWzDtRotsuR7tjRqsAmtsEaL1vwSqQRkog@mail.gmail.com
обсуждение исходный текст
Ответ на Re: LEFT JOINs not optimized away when not needed  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: LEFT JOINs not optimized away when not needed  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Tom,

Thanks for the reply.

On Tue, Jul 8, 2014 at 11:19 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> What's your setting of join_collapse_limit, and if it's less than
> 27, does raising it fix this query?
>

We raised it to 30 and restarted postgres but the query plan still touched
all of the tables. I'm not sure


> The GROUP BY has nothing to do with it, but if all the other tables' join
> keys are primary keys (or at least unique), I'd expect the planner to get
> rid of the joins.  However, I'm not sure whether it works completely when
> there are more than join_collapse_limit relations to worry about.
>

Not all of the join columns are unique, but most of them are unique, and
all of them are indexed on one side or the other... FWIW.


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 по дате отправления:

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