Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 3A5D39FA13E for ; Mon, 25 Sep 2006 18:43:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 17391-10 for ; Mon, 25 Sep 2006 21:43:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [131.203.101.226]) by postgresql.org (Postfix) with ESMTP id DF9549FA3A3 for ; Mon, 25 Sep 2006 18:43:11 -0300 (ADT) Received: from 222-152-186-122.jetstream.xtra.co.nz ([222.152.186.122] helo=[10.1.1.4]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1GRyEE-0007c5-FG; Tue, 26 Sep 2006 09:43:06 +1200 Message-ID: <45184D61.3010007@opencloud.com> Date: Tue, 26 Sep 2006 09:42:57 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.8 (X11/20060502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Markus Schaber CC: pgsql-jdbc@postgresql.org Subject: Re: Bind message References: <451846B0.6070906@logix-tt.com> In-Reply-To: <451846B0.6070906@logix-tt.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200609/107 X-Sequence-Number: 15825 Markus Schaber wrote: > Hi, Kris, > > Kris Jurka wrote: > >>Sometimes it is, sometimes the purpose of using a PreparedStatement is >>to avoid escaping data yourself for a plain Statement execution. There >>are potential performance penalties for using a "reusable" server side >>prepared statement because it plans them with generic parameters, not >>those supplied in your query. For this reason we want to be sure that >>people will actually be reusing these statements before switching to >>this mode. I believe the default prepareThreshold is set to 5 despite >>what the documentation says. > > > I remember having read something about delaying the actual planning > until the first parameterset arrives. The server only does this when you use the unnamed statement (i.e. before the driver's prepareThreshold is reached), because the resulting plan is only really useful for that particular set of parameter values, and using a named statement implies that you want to reuse the parse/plan results for other parameter values. -O