Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 33E329FB82F for ; Tue, 19 Jun 2007 12:46:53 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 58145-03-2 for ; Tue, 19 Jun 2007 12:46:33 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from oxford.xeocode.com (unknown [62.232.55.118]) by postgresql.org (Postfix) with ESMTP id A8F989FB784 for ; Tue, 19 Jun 2007 12:46:28 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.67) (envelope-from ) id 1I0fuO-0003n5-AB; Tue, 19 Jun 2007 16:46:20 +0100 From: Gregory Stark To: "Karl Wright" Cc: "Tom Lane" , Subject: Re: Performance query about large tables, lots of concurrent access In-Reply-To: <4677ECA9.3000402@metacarta.com> (Karl Wright's message of "Tue, 19 Jun 2007 10:48:09 -0400") Organization: EnterpriseDB References: <4676DD57.7070304@metacarta.com> <14291.1182221811@sss.pgh.pa.us> <4677B831.8060704@metacarta.com> <27690.1182263794@sss.pgh.pa.us> <4677ECA9.3000402@metacarta.com> X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.performance" 1089) Date: Tue, 19 Jun 2007 16:46:20 +0100 Message-ID: <873b0o7xrn.fsf@oxford.xeocode.com> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/356 X-Sequence-Number: 25389 "Karl Wright" writes: >> In this case it looks like the planner is afraid that that's exactly >> what will happen --- a cost of 14177 suggests that several thousand row >> fetches are expected to happen, and yet it's only predicting 5 rows out >> after the filter. It's using this plan anyway because it has no better >> alternative, but you should think about whether a different index >> definition would help. Another index won't help if the reason the cost is so high isn't because the index isn't very selective but because there are lots of dead tuples. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com