From: Jan Wieck <JanWieck@Yahoo.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: ivan <iv@psycho.pl>
Cc: pgsql-hackers@postgresql.org
Subject: Re: cache in plpgsql
Date: Fri, 02 Jan 2004 14:31:58 -0500
Message-ID: <3FF5C72E.3030402@Yahoo.com> (raw)
In-Reply-To: <7004.1073064082@sss.pgh.pa.us>
References: <Pine.LNX.4.56.0312302329590.5131@rex.anfa.pl>
<3FF2C608.3090906@Yahoo.com>
<Pine.LNX.4.56.0312311417500.20780@rex.anfa.pl>
<3FF2CFE0.70804@Yahoo.com>
<Pine.LNX.4.56.0401011655420.13912@rex.anfa.pl>
<3FF4DC86.1000400@Yahoo.com>
<2714.1073013920@sss.pgh.pa.us>
<3FF59802.4020607@Yahoo.com>
<7004.1073064082@sss.pgh.pa.us>
Tom Lane wrote:
> Jan Wieck <JanWieck@Yahoo.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.
Not sure what you mean by that. Is it the execution plan shortcut stuff
for simple expressions (you know, the faked econtext to evaluate just a
function call) that you want to move into SPI as well?
>
>> As said, the idea is neither bad, nor new. And please let's not forget
>> to add temp object detection into the dependency collector so that SPI
>> automagically will handle temp tables used in PL/pgSQL by NOT storing
>> prepared plans at all.
>
> Why shouldn't we cache plans for temp tables? They are good as long as
> the temp table exists. AFAICS the same dependency mechanism will work
> fine for temp and regular tables.
Good point. So you mean to call the SPI functionality to mark plans for
recompile at temp object destruction as well.
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: JanWieck@Yahoo.com, tgl@sss.pgh.pa.us, iv@psycho.pl
Subject: Re: cache in plpgsql
In-Reply-To: <3FF5C72E.3030402@Yahoo.com>
* 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