Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 538889FBEAD for ; Tue, 19 Jun 2007 13:12:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 91184-08 for ; Tue, 19 Jun 2007 13:12:14 -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 F094D9FBED8 for ; Tue, 19 Jun 2007 13:12:13 -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 1I0gJJ-0003o3-8h; Tue, 19 Jun 2007 17:12:05 +0100 From: Gregory Stark To: "Karl Wright" Cc: "Tom Lane" , Subject: Re: Performance query about large tables, lots of concurrent access In-Reply-To: <873b0o7xrn.fsf@oxford.xeocode.com> (Gregory Stark's message of "Tue, 19 Jun 2007 16:46:20 +0100") 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> <873b0o7xrn.fsf@oxford.xeocode.com> X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.performance" 1095) Date: Tue, 19 Jun 2007 17:12:05 +0100 Message-ID: <87y7if7wkq.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/361 X-Sequence-Number: 25394 "Gregory Stark" writes: > "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. Sorry, I didn't mean to say that was definitely the case, only that having bloated tables with lots of dead index pointers could have similar symptoms because the query still has to follow all those index pointers. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com