From: Tom Lane <tgl@sss.pgh.pa.us>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: pgsql-hackers@postgreSQL.org
Cc: pgsql-jdbc@postgreSQL.org
Subject: Re: Plan invalidation vs. unnamed prepared statements
Date: Tue, 06 Mar 2007 18:23:58 -0500
Message-ID: <12575.1173223438@sss.pgh.pa.us> (raw)
In-Reply-To: <1173222262.3760.2171.camel@silverbirch.site>
References: <6080.1173201777@sss.pgh.pa.us>
<1173222262.3760.2171.camel@silverbirch.site>
"Simon Riggs" <simon@2ndquadrant.com> writes:
> On Tue, 2007-03-06 at 12:22 -0500, Tom Lane wrote:
>> A. Just accept the extra overhead, thereby preserving the current
>> behavior of unnamed statements, and gaining the benefit that plan
>> invalidation will work correctly in the few cases where an unnamed
>> statement's plan lasts long enough to need replanning.
> With connection pooling, multiple sessions will execute each statement.
> If we check the cache each time this does seem more expensive for each
> individual session, but we should gain synergy from other similar
> sessions.
It seems fairly unlikely to me that client code would try to share an
unnamed statement across multiple application threads; the entire point
is that it's for one-off queries.
Or did you miss the point that the plan cache is local per-backend?
> ISTM there will be some cases where the current behaviour will not be
> maintained if we implement A exactly. One thing I've not seen mentioned
> is the effect of constants on various plans.
There is none.
regards, tom lane
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-jdbc@postgresql.org
Cc: tgl@sss.pgh.pa.us, simon@2ndquadrant.com, pgsql-hackers@postgreSQL.org
Subject: Re: Plan invalidation vs. unnamed prepared statements
In-Reply-To: <12575.1173223438@sss.pgh.pa.us>
References: <6080.1173201777@sss.pgh.pa.us> <1173222262.3760.2171.camel@silverbirch.site> <12575.1173223438@sss.pgh.pa.us>
* 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