Re: cache in plpgsql

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jan Wieck <JanWieck(at)Yahoo(dot)com>, ivan <iv(at)psycho(dot)pl>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: cache in plpgsql
Date: 2004-01-05 09:13:12
Message-ID: 20040105091311.GC13231@zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 02, 2004 at 12:21:22PM -0500, Tom Lane wrote:
> Jan Wieck <JanWieck(at)Yahoo(dot)com> writes:
> > Tom Lane wrote:
> >> Another little problem is that plpgsql doesn't really have any mechanism
> >> for invalidating cached stuff at all; it will leak memory like there's
> >> no tomorrow if we start dropping cached subplans.
>
> > Everyone seems to look at it as a PL/pgSQL specific problem. It is not!
>
> No, of course not, but plpgsql has issues of its own that (IMHO) should
> be solved along with the SPI-level problem.

My original PREPARE/EXECUTE patch contained SPI_saveplan() version that
save plan to query cache. I think it's pretty bad idea use for same
things more separate solutions. For example see RI stuff (triggeres) --
it's perfect adept for PREPARE/EXECUTE query cache instead the current
RI solution that save plans in own hash table. I think we can add
support for work with query cache to SPI and use it in more places (RI,
PL, etc.), something like SPI_saveplan_bykey().

Karel

--
Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
http://home.zf.jcu.cz/~zakkr/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Karel Zak 2004-01-05 09:36:05 Re: time format
Previous Message Oleg Bartunov 2004-01-05 08:34:55 Re: Composite GiST indexes?