Re: BUG #2150: PL/Python function delcared STABLE gets run repeatedly - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2150: PL/Python function delcared STABLE gets run repeatedly
Date
Msg-id 16701.1136576939@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #2150: PL/Python function delcared STABLE gets run repeatedly  ("Jim C. Nasby" <jnasby@pervasive.com>)
Responses Re: BUG #2150: PL/Python function delcared STABLE gets run repeatedly
List pgsql-bugs
"Jim C. Nasby" <jnasby@pervasive.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

pgsql-bugs by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: BUG #2150: PL/Python function delcared STABLE gets run repeatedly
Next
From: "Jim C. Nasby"
Date:
Subject: Re: BUG #2150: PL/Python function delcared STABLE gets run repeatedly