Re: unneeded joins on view

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: unneeded joins on view
Дата
Msg-id 534EA861.3020204@vmware.com
обсуждение исходный текст
Ответ на unneeded joins on view  (Linos <info@linos.es>)
Ответы Re: unneeded joins on view
Список pgsql-performance
On 04/16/2014 06:13 PM, Linos wrote:
> I thought that Postgresql would optimize out joins on columns I
> don't ask for when I use the view but it doesn't, this query:

It doesn't, because it would be wrong. It still has to check that the
tables have a matching row (or multiple matching rows).

If you use LEFT JOINs instead, and have a unique index on all the ID
columns, then the planner can do what you expected and leave out the joins.

- Heikki


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

Предыдущее
От: Linos
Дата:
Сообщение: unneeded joins on view
Следующее
От: Linos
Дата:
Сообщение: Re: unneeded joins on view