Teodor Sigaev <teodor@sigaev.ru> writes:
> I'd like to suggest to improve var_eq_non_const() by using knowledge of MCV and
> estimate the selectivity as quadratic mean of non-null fraction divided by
> number of distinct values (as it was before) and set of MCV selectivities.
What's the statistical interpretation of this calculation (that is,
the average MCV selectivity)? Maybe it's better, but without any
context it seems like a pretty random thing to do. In particular,
it seems like this could give radically different answers depending
on how many MCVs we chose to store, and I'm not sure we could argue
that the result gets more accurate with more MCVs stored.
regards, tom lane