Re: Too many function calls in view with LEFT JOIN

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Heiduk <Andreas(dot)Heiduk(at)web(dot)de>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Too many function calls in view with LEFT JOIN
Date: 2006-05-30 22:41:01
Message-ID: 4725.1149028861@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andreas Heiduk <Andreas(dot)Heiduk(at)web(dot)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.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2006-05-30 22:54:29 Re: strange (numeric) casting behaviour
Previous Message Alvaro Herrera 2006-05-30 21:47:34 Re: int64 and spi_getbinval bug !?