Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 34C479FB324 for ; Thu, 5 Jul 2007 07:09:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 05422-08 for ; Thu, 5 Jul 2007 07:09:02 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from aa003msb.fastweb.it (aa003msb.fastweb.it [85.18.95.82]) by postgresql.org (Postfix) with ESMTP id C15729FB2B2 for ; Thu, 5 Jul 2007 07:09:01 -0300 (ADT) Received: from fluca.local (85.18.239.131) by aa003msb.fastweb.it (7.3.118.6) id 466578FC016E6559 for pgsql-jdbc@postgresql.org; Thu, 5 Jul 2007 12:09:00 +0200 From: Flipper To: pgsql-jdbc@postgresql.org Subject: Re: prepared statement: are they pre-compiled? Date: Thu, 5 Jul 2007 12:08:59 +0200 User-Agent: KMail/1.9.7 References: <200707051023.25650.flipper@gammadue.com> <468CB19F.6080108@enterprisedb.com> In-Reply-To: <468CB19F.6080108@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200707051208.59443.flipper@gammadue.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200707/18 X-Sequence-Number: 17192 On Thursday 5 July 2007 Heikki Linnakangas's cat, walking on the keyboard, wrote: > It depends on the prepareThreshold parameter. The default is 5, which > means that the query is parsed and planned separately for each call to > executeQuery, until the 5th call. After that, a generic plan is > generated and used thereafter. Thanks for you explaination! Where is this default parameter set? I cannot find it. By the way, I cannot see the real difference in the code, and in fact the QueryExecutor goes into the sendParse with oneShot = false (since the flag has not been set). The sendParse creates a statement name and then sends the parse message. So the doubt is: the parse message is always sent and the server ignores it when a statement name is provided? Or is something in the Java code that I'm not getting? Thanks