>> What is the specific difference between what you are talking about and
>> what scalarineqsel already implements?
>
> Hmm... Northing new. Feel sorry for bothering you. I did not realize
> histograms are implemented.
>
Well, ISTM there is a profound difference. For scalarineqsel we care
about the total number of values in a bucket. For eqsel we care about
the total number of *distinct* values in each bucket ( which we don't
track ).
IMHO, the whole idea of increasing mcv's seems a mistake. Why not use
the limited storage in pg_statistic to try and estimate the
selectivity for ranges of values rather than a single value? That
gives way better coverage of the distribution. If the number of values
is too high to fit in a single bucket we put it in an mcv slot
anyways. *That* should be the mechanism by which the number of mcv's
increases.
I guess this is a bit off topic for the middle of a commit fest though.
-Nathan