Re: Too many function calls in view with LEFT JOIN - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Too many function calls in view with LEFT JOIN
Date
Msg-id 4725.1149028861@sss.pgh.pa.us
Whole thread Raw
In response to Too many function calls in view with LEFT JOIN  (Andreas Heiduk <Andreas.Heiduk@web.de>)
List pgsql-bugs
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.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: int64 and spi_getbinval bug !?
Next
From: Tom Lane
Date:
Subject: Re: strange (numeric) casting behaviour