Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id A3E0B9FA4A7 for ; Tue, 17 Oct 2006 17:28:55 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 24110-03 for ; Tue, 17 Oct 2006 20:28:52 +0000 (UTC) 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 817ED9FA3A3 for ; Tue, 17 Oct 2006 17:28:51 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id 30so31718ugc for ; Tue, 17 Oct 2006 13:28:50 -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=M3f9S0lPglgw2CMs2xPN7h45I2cQ1ci7M2bE5tQdPGrFfF3kd15kVLn6KvVw4jUIJclgh7i/7SsXKe4AJki65A9LExxczrZY8jk5xN7gP1YhpoUt3Zr535eQ2FFzRCepIkjyoYdLDwWfvxuGkSVHb3Wsxy+kZQXMz1eIDyaYugQ= Received: by 10.78.97.7 with SMTP id u7mr9931693hub; Tue, 17 Oct 2006 13:28:49 -0700 (PDT) Received: by 10.78.35.18 with HTTP; Tue, 17 Oct 2006 13:28:49 -0700 (PDT) Message-ID: Date: Tue, 17 Oct 2006 16:28:49 -0400 From: "Merlin Moncure" To: Rohit_Behl Subject: Re: Jdbc/postgres performance Cc: pgsql-performance@postgresql.org In-Reply-To: <407937EC76157D439EB0C9F9B6047EFD40017C@BLRKECMSG04.ad.infosys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <407937EC76157D439EB0C9F9B6047EFD40017C@BLRKECMSG04.ad.infosys.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/334 X-Sequence-Number: 21463 On 10/17/06, Rohit_Behl wrote: > Select events.event_id, ctrl.real_name, events.tsds, events.value, events.lds, events.correction, ctrl.type, ctrl.freq from table events, iso_midw_control ctrl where events.obj_id = ctrl.obj_id and events.event_id > ?::bigint order by events.event_id limit ? unfortunately parameterized limit statements cause problems due to the fact the planner has a hard coded 'guess' of 10% of rows returned when the plan is generated. I mention this everyime query hints proposal comes up :-). best you can do is to try turning off seqscan and possibly bitmap scan when the plan is generated. merlin