Re: Function result cacheing - any comments? - Mailing list pgsql-hackers

From Gavin Sherry
Subject Re: Function result cacheing - any comments?
Date
Msg-id Pine.LNX.4.21.0208191651190.9867-100000@linuxworld.com.au
Whole thread Raw
In response to Re: Function result cacheing - any comments?  (Joe Conway <mail@joeconway.com>)
Responses Re: Function result cacheing - any comments?  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Re: Function result cacheing - any comments?  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
On Sun, 18 Aug 2002, Joe Conway wrote:

> Philip Warner wrote:
> > So the obvious question is - in the opinion of people who know the code, 
> > can a function-result-cache be implemented with a lifetime of a single 
> > statement, without butchering the function manager?
> > 
> 
> I don't know if I fully understand what you're proposing, but if I 

Hi Joe,

What Philip seems to be asking for is a mechanism where by if a function
is marked as being mathematically deterministic (given a particular set of
parameters the same result is always returned -- eg: cos(), sin(),
etc) then the result is cached and next time the function is called with
the same argument(s) the result is retrieved from the cache instead of the
function being run again.

If I have got this correct, there is merit in this request. It is a
feature of other databases (such as oracle) and SQL99 provides for a
differentiation between deterministic and 'possibly non-deterministic'
routines. It does not discuss, to my knowledge, how this information
should be used.

I do not know if it is worth while implementing a deterministic function
result cache in Postgres -- I haven't looked at the complexity. Needless
to say, it would not be trivial :-).

Gavin




pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: set search_path failure
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: Function result cacheing - any comments?