Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 78E079F9287 for ; Sat, 29 Sep 2007 19:56:04 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 48907-03 for ; Sat, 29 Sep 2007 19:56:02 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id 99EA79F983B for ; Sat, 29 Sep 2007 19:56:01 -0300 (ADT) Received: from 222-154-155-16.jetstream.xtra.co.nz ([222.154.155.16] helo=[10.1.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1IblE4-0004sM-OU; Sun, 30 Sep 2007 11:55:57 +1300 Message-ID: <46FED7FA.6060309@opencloud.com> Date: Sun, 30 Sep 2007 11:55:54 +1300 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Josh Berkus CC: pgsql-jdbc@postgresql.org Subject: Re: Prepared Statements vs. pgbouncer References: <20070929002513.GG3140@inuus.com> <46FDA4F2.8080507@opencloud.com> <20070929021522.GH3140@inuus.com> <24584.1191033096@sss.pgh.pa.us> <20070929072159.GI3140@inuus.com> <46FE3B1A.7020603@agliodbs.com> In-Reply-To: <46FE3B1A.7020603@agliodbs.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/145 X-Sequence-Number: 17567 Josh Berkus wrote: > Actually, in that kind of an application, I don't see the theoretical > issue with S_1 being reused by different client connections. In an > ideal world, this would give us de-facto shared prepared plans. Or am I > misunderstanding the issue? S_1 from client 1 might be a completely different query to S_1 from client 2. The JDBC driver just numbers statements sequentially as they are used. > Also, should I understand that there now is no way in pgsql-jdbc to turn > prepared plans off, even if you want to? Right, and there never has been something like that since the V3 code was first added back in the (7.4? 8.0?) driver. Named statements are part of the V3 protocol, the driver expects the full protocol to be available. As I said if you wanted you could do driver modifications to tell the V3 protocol layer never to use named statements if you really wanted to, but if you're talking to something that implements the full V3 protocol (like, um, a postgresql backend..) there's no need. There are already knobs which let you tune whether user-generated queries use named statements or not, mostly because there are potential performance differences (unnamed statements can benefit from knowing the actual parameter values). For internal driver-generated queries that has not been an issue in the past so there's no tuning knob for them. -O