"Jim C. Nasby" <jnasby(at)pervasive(dot)com> writes:
> Is caching of results for STABLE/IMMUTABLE functions called with a
> constant something that would be reasonable to add?
I tend to think not: the distributed overhead would outweigh the
advantages. See previous discussions in the archives.
(However, the previous discussions have imagined an explicit cache
that stores function names, arguments, and results. Your thought
of transforming the call into an InitPlan node might be interesting.
The trick is still to know which functions are expensive enough to
justify the overhead of an InitPlan.)
regards, tom lane