Re: Convincing STABLE functions to run once - Mailing list pgsql-general

From Alban Hertroys
Subject Re: Convincing STABLE functions to run once
Date
Msg-id 735A8879-81B1-49A1-BCB8-13B78D081396@gmail.com
Whole thread Raw
In response to Convincing STABLE functions to run once  (Dan Wells <dbw2@calvin.edu>)
List pgsql-general
On 09 Sep 2014, at 17:23, Dan Wells <dbw2@calvin.edu> wrote:

> I often have functions which are not truly immutable (they do something minor, like read in configuration
information),but the functions themselves are fairly expensive, so I want them to run just once per query.  At face
value,I feel like STABLE should do what I want, but often it does not.   

Assuming that the part that makes these functions expensive is not the reading of the configuration information,
perhapsyou can split your functions such that the expensive part goes into an IMMUTABLE function that takes those
(STABLE)configuration values as input? 

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.



pgsql-general by date:

Previous
From: Jay at Verizon
Date:
Subject: Re: Pgpool starting problem
Next
From: Michael Paquier
Date:
Subject: Re: Crash in 9.4 Beta when partially collapsing left outer joins