Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> 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