Greg Stark <gsstark@mit.edu> writes:
> If the planner had the expected value as well as the variance of the cost
> distribution then it might realize that in this case for instance that the
> penalty for guessing wrong with an index scan is only going to be a small
> slowdown factor, perhaps 2-4x slower. Whereas the penalty for guessing wrong
> with a sequential scan could be a factor in the thousands or more.
Au contraire --- a full-table index scan can be vastly slower than a
full-table seqscan. I think it's wishful thinking to assume that
picking an indexscan is the right thing when we don't know any better.
regards, tom lane