Re: Performance of outer joins?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Performance of outer joins?
Дата
Msg-id 8617.1166309490@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Performance of outer joins?  (Benjamin Smith <ben@schoolpathways.com>)
Список pgsql-general
Benjamin Smith <ben@schoolpathways.com> writes:
>     FROM customers
>     JOIN calendars ON
>         (
>         -- GIVE A CALENDAR OF POSSIBLE DAYS FOR DELIVERIES
>         calendar.day < 20061201
>         AND calendar.day >= 20060101
>         )

Haven't you written a cross-product join here?  Seems like a bad
idea if you'd like it to be fast.  Especially since you then left-joined
it to something else, meaning that every row in the cross product
must in fact generate output.  Do you really want to be deluged with
a table showing all the customers you DIDN'T deliver to on each day,
for every day in the year?

            regards, tom lane

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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Failed to set permision Win2k3-PG Installation Issues
Следующее
От: TJ O'Donnell
Дата:
Сообщение: Re: Functions on tables