Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 036079FB2E7 for ; Wed, 18 Oct 2006 10:21:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 93985-09 for ; Wed, 18 Oct 2006 10:20:58 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by postgresql.org (Postfix) with ESMTP id A227F9FB289 for ; Wed, 18 Oct 2006 10:20:57 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id 30so150027ugc for ; Wed, 18 Oct 2006 06:20:56 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=HwuLW9ll1Ka+56XUiyS8BC3tw1NseDU6sjSxKBgBq4wtSDB/c79F4fqljw4ztB3FpowmYrJCKD7m6eBbjFdw2DIwPOB2wmXqrQpkcCh6JfrfMphs/M/iR5FE4BsxZluWoMVwZ8PYW9TAUURIebFvU+REnGy4/hzR2Xs+1IuVbqM= Received: by 10.82.109.19 with SMTP id h19mr1981080buc; Wed, 18 Oct 2006 06:20:54 -0700 (PDT) Received: by 10.78.35.18 with HTTP; Wed, 18 Oct 2006 06:20:54 -0700 (PDT) Message-ID: Date: Wed, 18 Oct 2006 09:20:54 -0400 From: "Merlin Moncure" To: "Heikki Linnakangas" Subject: Re: Jdbc/postgres performance Cc: Rohit_Behl , pgsql-performance@postgresql.org In-Reply-To: <45362363.2060904@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <407937EC76157D439EB0C9F9B6047EFD40017D@BLRKECMSG04.ad.infosys.com> <407937EC76157D439EB0C9F9B6047EFD40017E@BLRKECMSG04.ad.infosys.com> <45362363.2060904@enterprisedb.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.22 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/352 X-Sequence-Number: 21481 On 10/18/06, Heikki Linnakangas wrote: > I would suggest using setting "prepareThreshold=0" in the JDBC driver > connection URL, or calling pstmt.setPrepareThreshold(0) in the > application. That tells the driver not to use server-side prepare, and > the query will be re-planned every time you execute it with the real > values of the parameters. that works. I think another alternative is to just turn off seqscan temporarily for the session: set enable_seqscan=false; and re-enable it after prepareing the statement. however I agree that seqscan should be enabled for normal operation. in fact, this becomes more and more important as your database becomes really big due to poor random i/o of hard drives. merlin