Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 50A711337B43 for ; Wed, 16 Mar 2011 14:44:47 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 89439-05 for ; Wed, 16 Mar 2011 17:44:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 819471337BB9 for ; Wed, 16 Mar 2011 14:44:39 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Wed, 16 Mar 2011 12:44:39 -0500 Message-Id: <4D80B0AF020000250003B9B4@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Wed, 16 Mar 2011 12:44:31 -0500 From: "Kevin Grittner" To: Cc: , Subject: Re: Re: Adding additional index causes 20,000x slowdown for certain select queries - postgres 9.0.3 References: <4D80B076020000250003B9B1@gw.wicourts.gov> <4D80B0AF020000250003B9B4@gw.wicourts.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/170 X-Sequence-Number: 42849 Tom Lane wrote: > "Kevin Grittner" writes: >> We've seen a lot of those lately -- Index Scan Backward >> performing far worse than alternatives. > > It's not clear to me that that has anything to do with Tim's > problem. It certainly wouldn't be 20000x faster if it were a > forward scan. Well, that's one way of looking at it. Another would be that the slower plan with the backward scan was only estimated to be 14.5% less expensive than the fast plan, so a pretty moderate modifier would have avoided this particular problem. The fact that the backward scan mis-estimate may be combining multiplicatively with other mis-estimates doesn't make it less important. -Kevin