Re: Function result cacheing - any comments?

From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Philip Warner <pjw(at)rhyme(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Function result cacheing - any comments?
Date: 2002-08-19 07:03:18
Message-ID: Pine.LNX.4.21.0208191651190.9867-100000@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-08-19 07:18:14 Re: Function result cacheing - any comments?
Previous Message Tatsuo Ishii 2002-08-19 06:51:21 Re: set search_path failure