Philip Warner <pjw@rhyme.com.au> writes:
> At 15:41 19/08/2002 +0800, Christopher Kings-Lynne wrote:
>> So it seems Philip already has what he wants?
> I really hope so, but my understanding is that this information is used
> during optimization, not execution; I want it to be used in execution.
Philip is correct that there is no cacheing of the sort he wants.
The existing volatility classifications are somewhat relevant in the
sense that an IMMUTABLE or STABLE function would be legal to cache the
way he wants ... but the system doesn't do so, it only uses these
classifications to drive before-the-query constant folding and decisions
about whether indexscans are safe.
I would resist any attempt to install cacheing by default for immutable
or stable functions. Philip was proposing that function authors would
have to explicitly ask for cacheing (ie, add another function property)
and that seems a necessary component of an acceptable solution IMHO.
regards, tom lane