I don't recall, has it ever been considered to compare the number of
actual result rows against the estimate computed by the optimizer and then
draw some conclusions from it? Both numbers should be easily available.
Possible "conclusions" might be suggesting running analyze, suggesting
tweaking "M" and "K", assigning an out-of-whack factor to the statistics
(once it goes to infinity (or zero) you do one of the previous things), in
some future life possibly automatically switching to an alternative
statistics model.
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter