X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BFD8653B6F for ; Fri, 22 Apr 2005 08:48:47 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 98694-10 for ; Fri, 22 Apr 2005 11:48:36 +0000 (GMT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by svr1.postgresql.org (Postfix) with ESMTP id BEC6053B2C for ; Fri, 22 Apr 2005 08:48:34 -0300 (ADT) Received: from jefftrout.com ([24.61.201.181]) by comcast.net (rwcrmhc13) with SMTP id <20050422114836015004b4o0e>; Fri, 22 Apr 2005 11:48:37 +0000 Received: (qmail 61324 invoked from network); 22 Apr 2005 11:49:10 -0000 Received: from waltham-nat.ma.lycos.com (HELO ?10.124.7.66?) (209.202.205.1) by 192.168.0.109 with SMTP; 22 Apr 2005 11:49:10 -0000 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit Cc: performance pgsql From: Jeff Subject: Re: two queries and dual cpu (perplexed) Date: Fri, 22 Apr 2005 07:48:29 -0400 To: "Shoaib Burq (VPAC)" X-Mailer: Apple Mail (2.619.2) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.189 tagged_above=0 required=5 tests=AWL, RCVD_BY_IP, RCVD_IN_SORBS_DUL X-Spam-Level: X-Archive-Number: 200504/613 X-Sequence-Number: 12010 On Apr 21, 2005, at 11:33 PM, Shoaib Burq (VPAC) wrote: > > BTW I guess should mention that I am doing the select count(*) on a > View. > A bit of a silly question... but are you actually selecting all the rows from this query in production or would it be more selective? ie select * from bigslowview where bah = 'snort'? > Ran the Explain analyse with the nestedloop disabled but it was taking > forever... and killed it after 30mins. > If it takes too long you can run just plain explain (no analyze) and it will show you the plan. This is nearly always instant... it'll give you a clue as to if your setting changes did anything. You may need to end up breaking some parts of this up into subqueries. I've had to do this before. I had one query that just ran too dang slow as a join so I modified it into a subquery type deal. Worked great. However since you are selecting ALL rows I doubt that will help much. Another option may be to use materialized views. Not sure how "dynamic" your data model is. It could help. -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/