Re: Optimization idea

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Optimization idea
Дата
Msg-id 18893.1272063214@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Optimization idea  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Optimization idea
Список pgsql-performance
Robert Haas <robertmhaas@gmail.com> writes:
> Hmm.  We currently have a heuristic that we don't record a value as an
> MCV unless it's more frequent than the average frequency.  When the
> number of MCVs is substantially smaller than the number of distinct
> values in the table this is probably a good heuristic, since it
> prevents us from bothering with the recording of some values that are
> probably only marginally more interesting than other values we don't
> have space to record.  But if ndistinct is less than the stats target
> we could in theory record every value we find in the MCVs table and
> leave the histogram empty.

Which, in fact, is exactly what we do.  Cf analyze.c lines 2414ff
(as of CVS HEAD).  The heuristic you mention only gets applied after
we determine that a complete MCV list won't fit.

            regards, tom lane

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Replacing Cursors with Temporary Tables
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Optimization idea