Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 0CEB49F9B50 for ; Sat, 29 Sep 2007 01:15:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 85145-02 for ; Sat, 29 Sep 2007 01:14:59 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 5BA759F99A4 for ; Sat, 29 Sep 2007 01:15:00 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l8T4EABM025704; Sat, 29 Sep 2007 00:14:11 -0400 (EDT) To: Oliver Jowett cc: Paul Lindner , pgsql-jdbc@postgresql.org Subject: Re: Prepared Statements vs. pgbouncer In-reply-to: <46FDBB38.40003@opencloud.com> References: <20070929002513.GG3140@inuus.com> <46FDA4F2.8080507@opencloud.com> <20070929021522.GH3140@inuus.com> <46FDBB38.40003@opencloud.com> Comments: In-reply-to Oliver Jowett message dated "Sat, 29 Sep 2007 14:40:56 +1200" Date: Sat, 29 Sep 2007 00:14:10 -0400 Message-ID: <25703.1191039250@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/135 X-Sequence-Number: 17557 Oliver Jowett writes: > The driver uses server-side statements for frequently-used internal > utility commands such as BEGIN too, and the lifetime of those statements > is essentially "the whole connection", not a particular transaction. I'm kinda hijacking the thread here, because this question is unrelated to pgbouncer's behavior, but: have you ever done any performance measurement to prove that preparing BEGIN/COMMIT/ROLLBACK is a good idea? AFAICS there is only trivial parsing work to be saved, and no planning work, and yet the overhead of storing and referencing a prepared statement remains. My gut feeling is that this is at best a wash and could easily be a loss, particularly as of 8.3 which will have more overhead to maintain prepared statements. regards, tom lane