Re: Unnecessarily imprecise stats for very small tables leading to bad plans

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Unnecessarily imprecise stats for very small tables leading to bad plans
Дата
Msg-id 9101.1528298893@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Unnecessarily imprecise stats for very small tables leading to bad plans  (Andreas Seltenreich <andreas.seltenreich@credativ.de>)
Список pgsql-bugs
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


В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: psql crashes found when executing slash commands
Следующее
От: Frits Jalvingh
Дата:
Сообщение: Re: BUG #15225: [XX000] ERROR: invalid DSA memory alloc request size1073741824 / Where: parallel worker