Hello!

Tom Lane <[EMAIL PROTECTED]> wrote
> 
> Andreas Heiduk <[EMAIL PROTECTED]> 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 not matter in the first query but is 
necessary in the second one. Especially because the JOIN criterium is not 
affected by the 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


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to