Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 2AE229FB36B for ; Thu, 28 Sep 2006 21:09:24 -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 18339-05 for ; Fri, 29 Sep 2006 00:09:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 5776A9FB2C9 for ; Thu, 28 Sep 2006 21:09:18 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 8684256427; Thu, 28 Sep 2006 19:09:16 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Thu, 28 Sep 2006 19:09:16 -0500 Date: Thu, 28 Sep 2006 19:09:15 -0500 From: "Jim C. Nasby" To: Ben Cc: pgsql-performance@postgresql.org Subject: Re: any hope for my big query? Message-ID: <20060929000915.GI34238@nasby.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060929:bench@silentmedia.com::YPq5gDnKYKPLzduh:0000000000000000 0000000000000000000000002ZpE X-Hashcash: 1:20:060929:pgsql-performance@postgresql.org::iSkfph3LPVeyPRxy:00000 00000000000000000000000013MS X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200609/412 X-Sequence-Number: 21098 Instead of the IN, see if this is better: AND (SELECT count(*) FROM albumjoin aj WHERE aj.album = album.id) BETWEEN 15 AND 25.