Andreas Seltenreich <andreas.seltenreich@credativ.de> writes:
> Intuitively, I'd say pg_statistic can represent such a small dataset
> perfectly. But instead, most_common_values only contains one of the two
> distinct values. This seems like a bug to me. I looked at the code for
> why this is the case, but couldn't find an answer right-away. Any
> input?
ANALYZE has a hard-and-fast rule that a value must appear more than once
in the sample in order to possibly be considered an MCV.
Perhaps we could tinker with that if the sample is known to comprise
the entire table, but it feels a bit ad-hoc.
regards, tom lane