Re: BUG #2150: PL/Python function delcared STABLE gets run repeatedly

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: Aaron Swartz <me(at)aaronsw(dot)com>, pgsql-bugs(at)postgreSQL(dot)org
Subject: Re: BUG #2150: PL/Python function delcared STABLE gets run repeatedly
Date: 2006-01-06 19:48:59
Message-ID: 16701.1136576939@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jim C. Nasby 2006-01-06 19:56:40 Re: BUG #2150: PL/Python function delcared STABLE gets run repeatedly
Previous Message Berend Tober 2006-01-06 19:45:01 Re: Reordering columns in a table