Re: Too many function calls in view with LEFT JOIN

Поиск
Список
Период
Сортировка
От Andreas Heiduk
Тема Re: Too many function calls in view with LEFT JOIN
Дата
Msg-id 933433606@web.de
обсуждение исходный текст
Ответ на Too many function calls in view with LEFT JOIN  (Andreas Heiduk <Andreas.Heiduk@web.de>)
Список pgsql-bugs
Hello!


Tom Lane <tgl@sss.pgh.pa.us> wrote
>
> Andreas Heiduk <Andreas.Heiduk@web.de> writes:
> > If a view which calls a function is LEFT JOINed to a table but not all
> > result rows are matched by some criteria, then the function is called
> > for each row of the view nevertheless.
>
> > Note that this seems to happen only for left joins, not for a inner join.
>
> I believe that's because the column is required to go to NULL in an
> unjoined row.  With a non-strict function, evaluating it after the join
> could yield wrong answers.  Try making the function strict.

First: setting the function to STRICT really cuts down the number of function calls even with the SELECT via view.

But as far as I can tell both queries should always return the same results. So I don't understand why the STRICT does
notmatter in the first query but is necessary in the second one. Especially because the JOIN criterium is not affected
bythe function call. 


Oh, and sorry that I forgot the version: "PostgreSQL 8.1.4 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.0.4
20060507(prerelease) (Debian 4.0.3-3)" 

Best regards,
Andreas Heiduk


______________________________________________________________________
XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!
Jetzt gratis testen! http://freemail.web.de/home/landingpad/?mc=021130

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

Предыдущее
От: claus.pruefer@webcodex.de
Дата:
Сообщение:
Следующее
От: "Parang Saraf"
Дата:
Сообщение: Re: error starting service on win2k platform