X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3D4EA329EB0 for ; Tue, 21 Sep 2004 09:09:58 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 02048-08 for ; Tue, 21 Sep 2004 08:09:50 +0000 (GMT) Received: from mail.logi-track.com (burro.logi-track.com [213.239.193.212]) by svr1.postgresql.org (Postfix) with ESMTP id B75DA329E8B for ; Tue, 21 Sep 2004 09:09:51 +0100 (BST) Received: from kingfisher.intern.logi-track.com (G6358.g.pppool.de [80.185.99.88]) by mail.logi-track.com (Postfix) with ESMTP id 01F6F30550; Tue, 21 Sep 2004 10:09:53 +0200 (CEST) Received: from kingfisher.intern.logi-track.com (localhost [127.0.0.1]) by kingfisher.intern.logi-track.com (Postfix) with SMTP id A680BAB2F2; Tue, 21 Sep 2004 10:09:48 +0200 (CEST) Date: Tue, 21 Sep 2004 10:09:48 +0200 From: Markus Schaber To: Oliver Jowett Cc: pgsql-jdbc Subject: Re: raising the default prepareTheshold Message-ID: <20040921100948.052b6ead@kingfisher.intern.logi-track.com> In-Reply-To: <414CA8A0.7070707@opencloud.com> References: <414CA8A0.7070707@opencloud.com> Organization: logi-track ag, =?ISO-8859-15?Q?z=FCrich?= X-Mailer: Sylpheed-Claws 0.9.12a (GTK+ 1.2.10; i386-pc-linux-gnu) X-Face: Nx5T&>Nj$VrVPv}sC3IL&)TqHHOKCz/|)R$i"*r@w0{*I6w; UNU_hdl1J4NI_m{IMztq=>cmM}1gCLbAF+9\#CGkG8}Y{x%SuQ>1#t:; Z(|\qdd[i]HStki~#w1$TPF}:0w-7"S\Ev|_a$K wrote: > However, with a 8.0 backend, if the planner benefits from knowing the=20 > particular parameter values in use for a particular query, then using an= =20 > unnamed statement may be faster due to using an improved plan. Under 7.4= =20 > there will be no difference; both named and unnamed statements will use= =20 > the generic plan. Quoting from http://developer.postgresql.org/beta-history.txt: * Plan prepared queries only when first executed so constants can be used for statistics (Oliver Jowett) Prepared statements plan queries once and execute them many times. While prepared queries avoid the overhead of re-planning on each use, the quality of the plan suffers from not knowing the exact parameters to be used in the query. In this release, planning of unnamed prepared statements is delayed until the first execution, and the actual parameter values of that execution are used as optimization hints. So it seems that your issue is addressed in 8.0 - as long as the Beta of the Readme is correct :-) HTH, Markus --=20 markus schaber | dipl. informatiker logi-track ag | rennweg 14-16 | ch 8001 z=FCrich phone +41-43-888 62 52 | fax +41-43-888 62 53 mailto:schabios@logi-track.com | www.logi-track.com