Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 5E9129FB287 for ; Tue, 26 Sep 2006 05:49:17 -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 23108-02 for ; Tue, 26 Sep 2006 08:49:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id 8954E9FB21D for ; Tue, 26 Sep 2006 05:49:12 -0300 (ADT) Received: from kingfisher.intern.logix-tt.com (84-72-188-217.dclient.hispeed.ch [84.72.188.217]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 1308865977 for ; Tue, 26 Sep 2006 10:51:31 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id E874E181AC330 for ; Tue, 26 Sep 2006 10:49:10 +0200 (CEST) Message-ID: <4518E986.3030801@logix-tt.com> Date: Tue, 26 Sep 2006 10:49:10 +0200 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Thunderbird 1.5.0.5 (X11/20060812) MIME-Version: 1.0 Cc: pgsql-jdbc@postgresql.org Subject: Re: Bind message References: <451846B0.6070906@logix-tt.com> <45184D61.3010007@opencloud.com> In-Reply-To: <45184D61.3010007@opencloud.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200609/112 X-Sequence-Number: 15830 Hi, Oliver, Oliver Jowett wrote: >> 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. Ah. But usually, the other parameter values for the same prepared statement produce similar query plans, because they're the same use case on similar data. So, at least for most of the apps we're running here, the first set of parameters makes more sense than planning without any parameters. Maybe this behaviour should be configurable via some session configuration variable? And for applications that really have two very different usecases resulting in identical prepared statements, it's affordable to either switch the delayed planning of, or to prepare the statement twice, with different names and different first parameter sets. Maybe we should crosspost this to pg_hackers? Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org www.nosoftwarepatents.org