>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
Tom> Also, the way that the value is calculated in theTom> samples-not-all-distinct case corresponds to the way I have
itinTom> the patch.
Ahh, gotcha. You're referring to this:
/* * If we estimated the number of distinct values at more than 10% of * the total row count (a
veryarbitrary limit), then assume that * stadistinct should scale with the row count rather than be a fixed
* value. */ if (stats->stadistinct > 0.1 * totalrows) stats->stadistinct = -(stats->stadistinct
/totalrows);
where "totalrows" includes nulls obviously. So this expects negative
stadistinct to be scaled by the total table size, and the all-distinct
case should do the same.
Objection withdrawn.
--
Andrew (irc:RhodiumToad)