pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Paul Lindner <lindner@inuus.com>
Cc: Gregory Stark <stark@enterprisedb.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Prepared Statements vs. pgbouncer
Date: Mon, 01 Oct 2007 21:26:50 +1300
Message-ID: <4700AF4A.4020105@opencloud.com> (raw)
In-Reply-To: <20071001081720.GM3140@inuus.com>
References: <20070929002513.GG3140@inuus.com>
	<87sl4xvmn2.fsf@oxford.xeocode.com>
	<20070929144635.GK3140@inuus.com>
	<46FED6A2.8000209@opencloud.com>
	<20070930070725.GL3140@inuus.com>
	<46FF4C08.2090608@opencloud.com>
	<20071001081720.GM3140@inuus.com>

Paul Lindner wrote:

>   2) Before preparing a statement with a hashed name, send a close
>      statement to insure that we don't get an error inside of a
>      transaction.

But that defeats the purpose of using a named statement in the first 
place -- and any potential benefit you'd get by sharing statements 
between clients -- if you're going to throw it away before reusing it 
every time!

> This is just as performant as the current driver which will happily
> re-prepare the same SQL many times.

No. The current driver will switch to a named statement that is prepared 
*once* when it thinks there is a benefit to doing so (tunable via 
prepareThreshold). Your change would mean that it would always 
re-prepare statements. Unless you're talking about a statement cache so 
that applications don't have to hold onto a particular PreparedStatement 
object to get the benefit of reuse, which arguably is the responsibility 
of the appserver (see the list archives for recent discussion of this).

> I do hope that you'll find any work done
> useful for general consumption.

Unfortunately, I still don't really see any these solutions to your 
particular problem as something that'd be useful in the general driver. 
I think your efforts would be better spent in teaching pgbouncer to deal 
with named statements properly..

-O



view thread (48+ messages)  latest in thread

Message-ID: <4700AF4A.4020105@opencloud.com>
Permalink:  ../4700AF4A.4020105@opencloud.com/
Also on:    postgresql.org/message-id/4700AF4A.4020105@opencloud.com

 · 

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-jdbc@postgresql.org
  Cc: oliver@opencloud.com, lindner@inuus.com, stark@enterprisedb.com
  Subject: Re: Prepared Statements vs. pgbouncer
  In-Reply-To: <4700AF4A.4020105@opencloud.com>
  References: <20070929002513.GG3140@inuus.com> <87sl4xvmn2.fsf@oxford.xeocode.com> <20070929144635.GK3140@inuus.com> <46FED6A2.8000209@opencloud.com> <20070930070725.GL3140@inuus.com> <46FF4C08.2090608@opencloud.com> <20071001081720.GM3140@inuus.com> <4700AF4A.4020105@opencloud.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