Re: Bogus ANALYZE results for an otherwise-unique column with many nulls
| От | Andrew Gierth |
|---|---|
| Тема | Re: Bogus ANALYZE results for an otherwise-unique column with many nulls |
| Дата | |
| Msg-id | 87oa57dsnn.fsf@news-spur.riddles.org.uk обсуждение |
| Ответ на | Re: Bogus ANALYZE results for an otherwise-unique column with many nulls (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: Bogus ANALYZE results for an otherwise-unique column with many nulls
|
| Список | pgsql-hackers |
>>>>> "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)
В списке pgsql-hackers по дате отправления: