Search Postgresql Archives

Re: Convincing STABLE functions to run once

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09 Sep 2014, at 17:23, Dan Wells <dbw2@xxxxxxxxxx> 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, perhaps you 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.



-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux