Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 18248B5DC01 for ; Mon, 19 Sep 2011 21:39:39 -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 96425-09 for ; Tue, 20 Sep 2011 00:39:32 +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 91845B5DC00 for ; Mon, 19 Sep 2011 21:39:32 -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 p8K0dVbs025674; Mon, 19 Sep 2011 20:39:31 -0400 (EDT) To: Maciek Sakrejda cc: =?UTF-8?Q?Rados=C5=82aw_Smogura?= , pgsql-jdbc@postgresql.org Subject: Re: binary patch problems In-reply-to: References: <4E4ADB2A.5040902@gmail.com> <4E774962.4060904@nitorcreations.com> <16752.1316443632@sss.pgh.pa.us> <201109191926.43305.rsmogura@softperience.eu> Comments: In-reply-to Maciek Sakrejda message dated "Mon, 19 Sep 2011 11:18:32 -0700" Date: Mon, 19 Sep 2011 20:39:31 -0400 Message-ID: <25673.1316479171@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/71 X-Sequence-Number: 22189 Maciek Sakrejda writes: > I think what Tom is saying is that you'll be able to set > prepareThreshold to 1 in the driver (always use named server-side > prepared statements) and the server will automagically do the right > thing. Right now, the big problem is that only unnamed prepared > statements include the "feature" of being able to consider parameters > in the query plan (since unnamed statements are not reused, there's no > sense in planning them before you have parameters). Right. We've rejiggered the backend so that planning is delayed until parameter values are available in all cases. (If the code finds that the plans it's getting with the parameters aren't materially better than a generic plan would be, it'll eventually go back to using generic plans. But hopefully you will never need to club it over the head to avoid doing that.) Anyway, this isn't going to hit the street for another year, so there's no reason to worry about it too much right now. I'm just saying you shouldn't invest a lot of work in related areas without being aware that that change is coming. regards, tom lane