Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id A3A8E9FB5A1 for ; Sat, 24 Feb 2007 16:48:02 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 30949-09 for ; Sat, 24 Feb 2007 16:47:55 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.237]) by postgresql.org (Postfix) with ESMTP id 21B699FB41E for ; Sat, 24 Feb 2007 16:47:57 -0400 (AST) Received: by wr-out-0506.google.com with SMTP id i21so792963wra for ; Sat, 24 Feb 2007 12:47:57 -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:mime-version:content-type:content-transfer-encoding:content-disposition; b=SA4bxDBCfVjl6xOMniHG36TdH41Bb9DTgh6w89wQDXQ4TB4SLys9b05l8ZCWKVt/7ys3ca+92NTSoudAvIIyCpQvAk0YEdeZ3fmzxl6+OkDy/75mr3PKu2+zWnldifnKh1oXP/MXQQf1p8ISGhUOKO1Tkx4HVUZJ40bpL5vmL4Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=CiBex8n4dJAvPyV+eO7NbscceDAAejcyR4+hX0IU1XsDKAZlLEAoDIBMk+ffcxgL57nc9wgGCrBv68ZuOgSC3hbWg3JJmNv2RsHN85fbZUCO29GD4Gss59p6X07UIcz9IU4tTw3tjBcJhFbyKa/dixLDnjSlhK1ndNsp8SuU2F8= Received: by 10.114.110.1 with SMTP id i1mr800525wac.1172350076570; Sat, 24 Feb 2007 12:47:56 -0800 (PST) Received: by 10.114.196.13 with HTTP; Sat, 24 Feb 2007 12:47:56 -0800 (PST) Message-ID: <430d92a20702241247m421b575bnfb1cb604fe8d6649@mail.gmail.com> Date: Sat, 24 Feb 2007 15:47:56 -0500 From: Gene Reply-To: gene@sotech.us To: pgsql-jdbc@postgresql.org Subject: parameterized queries and prepareThreshold MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/125 X-Sequence-Number: 16681 I'm using version 8.2.3 with latest jdbc and noticed that certain queries take a very long time even though I have partial indexes that it should be using. It uses them and performs very quickly if I hard code the constants (no preparedStmt) and do an explain. I noticed this in the changelog and figured it was the problem but wanted to make sure I wasn't on a wild goose chase: "Protocol-level unnamed prepared statements are re-planned for each set of BIND values (Tom) This improves performance because the exact parameter values can be used in the plan." I'm using hibernate and can't determine from the docs if what they use are considered named/unnamed as stated in the docs above but i'm guessing by the results they are (S_123/C_124). LOG: duration: 23926.439 ms execute S_123/C_124: select ... PIV1 = ? OR PIV2 = ? ... DETAIL: parameters: $1 = 'PARTIALINDEXVALUE1', $2 = 'PARTIALINDEXVALUE2' In hibernate this is my connection string: org.postgresql.Driver org.hibernate.dialect.PostgreSQLDialect jdbc:postgresql://192.168.106.191/isis?autoReconnect=true;prepareThreshold=0 can i verify somehow that the prepareThreshold parameter is making it into the jdbc driver? thanks for any help -- Gene Hart