Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 4BF469FB915 for ; Mon, 26 Feb 2007 12:45:59 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 46982-01 for ; Mon, 26 Feb 2007 12:45:37 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id 130859FB973 for ; Mon, 26 Feb 2007 12:45:32 -0400 (AST) Received: (qmail 23701 invoked by uid 1112); 26 Feb 2007 16:45:24 -0000 Date: Mon, 26 Feb 2007 11:45:24 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: gene@sotech.us cc: pgsql-jdbc@postgresql.org, pgsql-performance@postgresql.org Subject: Re: does prepareThreshold work? forced to use old driver In-Reply-To: <430d92a20702260812le88fb59w3ec40089db7b54dd@mail.gmail.com> Message-ID: References: <430d92a20702260812le88fb59w3ec40089db7b54dd@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/129 X-Sequence-Number: 16685 On Mon, 26 Feb 2007, Gene wrote: > I've been having some serious performance issues with > postgresql8.2/hibernate/jdbc due to postgres reusing bad cached query > plans. It doesn't look at the parameter values and therefore does not > use any partial indexes. > > After trying to set prepareThreshold=0 in the connection string which > didnt work, even modifying the jdbc driver and forcing it to 0 and not > working I realized that it must be being ignored. After giving up > pretty much I tried a much older driver which doesn't use server > prepared statements at all the problem has gone away and it is once > again using the partial indexes. How can I get this to work properly > on the new jdbc driver? I don't really like having to use a 2 year old > driver to get good performance as you can imagine :) Something must be going wrong in the setting to zero or your code may be setting it to non-zero at some later point. I believe prepareThreshold=0 should work. Do you have a test case showing it doesn't? Kris Jurka