Unix Technical Forum

Re: Too many function calls in view with LEFT JOIN

This is a discussion on Re: Too many function calls in view with LEFT JOIN within the pgsql Bugs forums, part of the PostgreSQL category; --> Hello! Tom Lane <tgl@sss.pgh.pa.us> wrote > > Andreas Heiduk <Andreas.Heiduk@web.de> writes: > > If a view which calls a ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 10:01 AM
Andreas Heiduk
 
Posts: n/a
Default Re: Too many function calls in view with LEFT JOIN

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 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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:02 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com