Re: Function result cacheing - any comments?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>, "Gavin Sherry" <swm(at)linuxworld(dot)com(dot)au>, "Joe Conway" <mail(at)joeconway(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Function result cacheing - any comments?
Date: 2002-08-19 14:33:35
Message-ID: 6765.1029767615@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
> At 15:41 19/08/2002 +0800, Christopher Kings-Lynne wrote:
>> So it seems Philip already has what he wants?

> I really hope so, but my understanding is that this information is used
> during optimization, not execution; I want it to be used in execution.

Philip is correct that there is no cacheing of the sort he wants.

The existing volatility classifications are somewhat relevant in the
sense that an IMMUTABLE or STABLE function would be legal to cache the
way he wants ... but the system doesn't do so, it only uses these
classifications to drive before-the-query constant folding and decisions
about whether indexscans are safe.

I would resist any attempt to install cacheing by default for immutable
or stable functions. Philip was proposing that function authors would
have to explicitly ask for cacheing (ie, add another function property)
and that seems a necessary component of an acceptable solution IMHO.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Curt Sampson 2002-08-19 14:42:51 Re: Inheritance
Previous Message Zeugswetter Andreas SB SD 2002-08-19 14:30:46 Re: Inheritance