> This topic seems to come up a lot. Is there something we are missing in
> the FAQ?
Most of the reports we seem to see are the usual, "but the seq scan is actually
faster" case. Daniel actually has a case where the optimizer chooses a bad plan.
The difficulty seems to be, that the optimizer cooses a correct plan for an idle
system, but with his workload the index path would be far better (2 vs 4 Minutes).
This is one of the main problems of the current optimizer which imho rather
aggressively chooses seq scans over index scans. During high load this does
not pay off. My preference would actually be a way to make the optimizer
choose a plan that causes minimal workload, and not shortest runtime
(which will obviously only be fast with low overall workload)
The reasoning behind this is, that during low workload your response times
will be good enough with a "bad" plan, but during high workload your response
times will be best with a plan that produces the least additional workload.
Andreas