Dan Harris <fbsd@drivefaster.net> writes:
> I wonder why the estimates were so far off the first time? This table
> has been ANALYZED regularly ever since creation.
Probably just that you need a bigger sample size for such a large table.
We've been arguing ever since 7.2 about what the default statistics
target ought to be --- a lot of people think 10 is too small. (It could
also be that the fixed 300X multiplier ought to depend on table size
instead. The math that told us 300X was OK was really about getting the
histogram right, not about whether the most-common-values stats would be
any good.)
regards, tom lane