Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 7A7079FB381 for ; Mon, 26 Feb 2007 13:41:44 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 76241-03 for ; Mon, 26 Feb 2007 13:41:30 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.233]) by postgresql.org (Postfix) with ESMTP id 051719FB321 for ; Mon, 26 Feb 2007 13:41:30 -0400 (AST) Received: by nz-out-0506.google.com with SMTP id r28so440158nza for ; Mon, 26 Feb 2007 09:41:28 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=fFa66xlUfstlpOJQ85YglU9n2D5R4c2Yo6omzyyg2cuNdTT46plxohImgUyJLLCyEHvVtazXLCYRUPruo2HH57KJ0fXwyDK8qDA3HgeL98m3ylhzzgGI6AQbeXg2QRl8YK0h43satPA1kRKGSN15RMu7IgROi9I7uqK2FWP+5Z0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=bItuSb4N5A9nj7+V0ZCT+wmp9/Qm6P6M9yIVXGgC8CLXRmBRFea0j+Z2Z1BiVYwi0FCjQ6eGBu8I7nmsSpSqd9CGRcajH4mwXYQ5H0D0LHc5IaKXhTr08oQAl/IbVMT0YArhFLgReCb0Qeb9dgYyuvzRbvBignU/nHV1+xsPK/A= Received: by 10.115.33.1 with SMTP id l1mr1007145waj.1172511687902; Mon, 26 Feb 2007 09:41:27 -0800 (PST) Received: by 10.114.198.6 with HTTP; Mon, 26 Feb 2007 09:41:24 -0800 (PST) Message-ID: <430d92a20702260941j58dd77adsb9b48ed6511230ec@mail.gmail.com> Date: Mon, 26 Feb 2007 12:41:24 -0500 From: Gene Reply-To: gene@sotech.us To: "Dave Cramer" Subject: Re: does prepareThreshold work? forced to use old driver Cc: pgsql-jdbc@postgresql.org, pgsql-performance@postgresql.org In-Reply-To: <61223CAE-09EB-4FC0-987D-1542AA0F03F1@fastcrypt.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <430d92a20702260812le88fb59w3ec40089db7b54dd@mail.gmail.com> <61223CAE-09EB-4FC0-987D-1542AA0F03F1@fastcrypt.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/134 X-Sequence-Number: 16690 Thank you! setting the protocolVersion=2 works with the newer driver. I'm still puzzled as to why the prepareThreshold=0 doesn't force the replan though. On 2/26/07, Dave Cramer wrote: > > On 26-Feb-07, at 11:12 AM, Gene wrote: > > > hi! > > > > 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 :) > > > > Could someone point me to a jdbc src file where I could just disable > > server-side prepared statements entirely? > > > you can just add protocolVersion=2 to the url and it will not use > prepared statements. > > setting prepareThreshold=0 just tells it not to use named statements. > It will still use statements but won't cache them. > > Are you sure the problem is with cached statements ? There are issues > where prepared statements won't use the index if you don't use the > correct type. > > Dave > > -- > > thanks, G > > > > ---------------------------(end of > > broadcast)--------------------------- > > TIP 3: Have you checked our extensive FAQ? > > > > http://www.postgresql.org/docs/faq > > > > -- Gene Hart cell: 443-604-2679