"Craig A. James" <cjames(at)modgraph-usa(dot)com> writes:
> This doesn't seem right to me -- how can the optimizer possibly know that a
> function doesn't have a side effect, as in my case? Functions could do all
> sorts of things, such as logging activity, filling in other tables, etc, etc.
The optimizer can know this if the user tells it so by marking the function
IMMUTABLE. If the function is marked VOLATILE then the optimizer can know it
might have side effects.
However that's not enough to explain what you've shown. How about you show the
actual query and actual plan you're working with? The plan you've shown can't
result from the query you sent.
In response to
pgsql-performance by date
|Next:||From: Mario Splivalo||Date: 2006-06-11 21:42:20|
|Subject: Re: scaling up postgres|
|Previous:||From: Jim C. Nasby||Date: 2006-06-11 17:48:37|
|Subject: Re: function not called if part of aggregate|