Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id C36A7B5DC02 for ; Mon, 19 Sep 2011 11:47:19 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 68330-07 for ; Mon, 19 Sep 2011 14:47:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 57CBCB5DBD1 for ; Mon, 19 Sep 2011 11:47:12 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p8JElC3Z016753 for ; Mon, 19 Sep 2011 10:47:12 -0400 (EDT) To: pgsql-jdbc@postgresql.org Subject: Re: binary patch problems In-reply-to: <4E774962.4060904@nitorcreations.com> References: <4E4ADB2A.5040902@gmail.com> <4E53FE39.40501@gmail.com> <4E6FA3DA.5090805@gmail.com> <4E77155D.8050200@gmail.com> <4E774962.4060904@nitorcreations.com> Comments: In-reply-to Mikko Tiihonen message dated "Mon, 19 Sep 2011 16:53:38 +0300" Date: Mon, 19 Sep 2011 10:47:12 -0400 Message-ID: <16752.1316443632@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/60 X-Sequence-Number: 22178 Mikko Tiihonen writes: > On 09/19/2011 01:11 PM, Bodor Andras wrote: >> Why don't you set prepareThreshold to 0 for your test cases? >> In this case parameter passing starts immediately for the >> prepared statement, and ForceBinaryTransfers can be dropped. > AbstractJdbc2Statement: > public boolean isUseServerPrepare() { > return (preparedQuery != null && m_prepareThreshold != 0 && m_useCount + 1 >= m_prepareThreshold); > } > If I read the above correctly then prepareThreshold of 0 disables prepared statements. But "1" would do what you want, no? FWIW, I'm hoping that this entire business of delaying the server-side prepare will be obsolete as of 9.2. There is already code committed in HEAD that allows "prepared" statements to be re-planned for each new set of parameter values, with a somewhat-informed choice of whether and when to switch over to the traditional generic-plan approach. It needs tweaking for performance still, no doubt, but there is not going to be a reason for the driver to do this anymore. Obviously that's not much use for solving your immediate problem, but it might lead you to conclude that putting a large amount of effort into improving this mechanism would be a dead end. regards, tom lane