pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Donald Fraser <postgres@kiwi-fraser.net>
Cc: [ADMIN] <pgsql-admin@postgresql.org>
Subject: Re: Are cached IMMUTABLE values persistent between sessions
Date: Thu, 23 Jun 2005 09:00:23 -0600
Message-ID: <20050623150023.GA36745@winnie.fuhr.org> (raw)
In-Reply-To: <002301c577f7$28141780$6364a8c0@DonAcer>
References: <002301c577f7$28141780$6364a8c0@DonAcer>

On Thu, Jun 23, 2005 at 02:26:23PM +0100, Donald Fraser wrote:
>
> Is the returned value of a function defined as IMMUTABLE cached
> globally?  In other words could postgresql potentially return a
> cached value obtained from one client session to a different client
> session?

You could experiment with this by adding a debugging RAISE statement
to an IMMUTABLE PL/pgSQL function to see when it's called.  I suspect
there's no global caching; if there is then I haven't been able to
make it happen in tests.  There doesn't even appear to be any caching
between disparate queries in the same session unless a prepared
plan is involved (e.g., a plan made with PREPARE or a cached plan
from a PL/pgSQL function) and the result of the IMMUTABLE function
could be determined at planning time.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/



view thread (5+ messages)  latest in thread

Message-ID: <20050623150023.GA36745@winnie.fuhr.org>
Permalink:  ../20050623150023.GA36745@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20050623150023.GA36745@winnie.fuhr.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mike@fuhr.org, postgres@kiwi-fraser.net
  Subject: Re: Are cached IMMUTABLE values persistent between sessions
  In-Reply-To: <20050623150023.GA36745@winnie.fuhr.org>
  References: <002301c577f7$28141780$6364a8c0@DonAcer> <20050623150023.GA36745@winnie.fuhr.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox