pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pg@fastcrypt.com
Cc: Josh Berkus <josh@agliodbs.com>
Cc: Heikki Linnakangas <heikki@enterprisedb.com>
Cc: lindner@inuus.com
Cc: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Prepared Statements vs. pgbouncer
Date: Tue, 2 Oct 2007 14:38:38 +0200
Message-ID: <20071002123838.GA1462@depesz.com> (raw)
In-Reply-To: <19675.1191264250@sss.pgh.pa.us>
References: <24584.1191033096@sss.pgh.pa.us>
	<20070929072159.GI3140@inuus.com>
	<46FE3B1A.7020603@agliodbs.com>
	<46FED7FA.6060309@opencloud.com>
	<46FFC314.5080205@agliodbs.com>
	<47000C2E.8030409@opencloud.com>
	<4700B21C.1000008@enterprisedb.com>
	<47013A0E.6080607@agliodbs.com>
	<47013E0F.8050508@fastcrypt.com>
	<19675.1191264250@sss.pgh.pa.us>

On Mon, Oct 01, 2007 at 02:44:10PM -0400, Tom Lane wrote:
> Dave Cramer <pg@fastcrypt.com> writes:
> > Josh Berkus wrote:
> >> So where is it going to be easier to fix this ... pgBouncer, or pg-JDBC?
> > pgBouncer is broken so I'd fix it.
> It's an enormous mistake to imagine that prepared statements are the
> only issue.  What about GUC settings and temp tables, to mention a
> couple other bits of per-session state?

i think that calling it broken is "a bit" far fetched.

i dont know how familiar you are with pgbouncer, but the mode in which
paul ran pgbouncer is *purposedly* not working correctly with prepared
statement.s

basically - ppgbouncer supports 3 modes:
- session pooling
- transaction pooling
- statement pooling.

description of all of them is clear in manual:

------------------------------
  Session pooling::
    Most polite method.  When client connects, a server connection
    will be assigned to it for the whole duration it stays connected.
    When client disconnects, the server connection will be put back
    into pool.

  Transaction pooling::
    Server connection is assigned to client only during a transaction.
    When PgBouncer notices that transaction is over, the server
    will be put back into pool.

  Statement pooling::
    Most aggressive method.  The server connection will be put back into
    pool immidiately after a query completes.  Multi-statement
    transactions are disallowed in this mode as they would break.
------------------------------

so, pgbouncer is not broken. if you want to keep your connection between
transactions (which is perfectly sensible) - use session pooling.

both transaction pooling and statement pooling are modes which trade
some performance for missing features.

i wouldn't suggest anyone using statement pooling, but if i would use
it, then what right do i have to complain about bad transactions?!

best regards,

depesz

-- 
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA.  here's my CV!" :)
http://www.depesz.com/ - blog dla ciebie (i moje CV)



view thread (48+ messages)  latest in thread

Message-ID: <20071002123838.GA1462@depesz.com>
Permalink:  ../20071002123838.GA1462@depesz.com/
Also on:    postgresql.org/message-id/20071002123838.GA1462@depesz.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: depesz@depesz.com, tgl@sss.pgh.pa.us, pg@fastcrypt.com, josh@agliodbs.com, heikki@enterprisedb.com, lindner@inuus.com, oliver@opencloud.com
  Subject: Re: Prepared Statements vs. pgbouncer
  In-Reply-To: <20071002123838.GA1462@depesz.com>
  References: <24584.1191033096@sss.pgh.pa.us> <20070929072159.GI3140@inuus.com> <46FE3B1A.7020603@agliodbs.com> <46FED7FA.6060309@opencloud.com> <46FFC314.5080205@agliodbs.com> <47000C2E.8030409@opencloud.com> <4700B21C.1000008@enterprisedb.com> <47013A0E.6080607@agliodbs.com> <47013E0F.8050508@fastcrypt.com> <19675.1191264250@sss.pgh.pa.us> <20071002123838.GA1462@depesz.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