Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Martijn van Oosterhout wrote:
>> Firstly, I was only thinking of going for the basic nodes (Index Scan, Seq
>> Scan, Distinct). Other types have far more variables. Secondly, even if you
>> only count, it's useful. For example, if it tells you that the planner is
>> off by a factor of 10 more than 75% of the time, that's useful information
>> independant of what the actual variables are.
> Yes, only updating the stats if the estimate was off by a factor of 10
> or so should cut down on the overhead.
And reduce the usefulness even more ;-). As a pure stats-gathering
exercise it might be worth doing, but not if you only log the failure
cases. How will you know how well you are doing if you take a
biased-by-design sample?
regards, tom lane