Re: Statistics collection question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Statistics collection question
Дата
Msg-id 8091.1188828012@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Statistics collection question  ("Phoenix Kiula" <phoenix.kiula@gmail.com>)
Ответы Re: Statistics collection question  ("Phoenix Kiula" <phoenix.kiula@gmail.com>)
Список pgsql-general
"Phoenix Kiula" <phoenix.kiula@gmail.com> writes:
> A couple of questions about the "most_common_vals" stuff in pg_stats
> for a high traffic table:

> 1. Can I tell the stats collector to collect only values of a column
> where a certain regex is matched?

Not directly, but you could set up a partial index defined that way,
and ANALYZE would collect stats on the index contents.  Whether the
planner could actually do anything with the information is another
story; I suspect you're wasting your time with this idea.

> 2. Secondly, for a unique column in the table, will the
> "most_common_vals" always be -1? I guess this could make sense, but I
> was wondering if the stats collector could somehow collect at least
> 1000 unique values to improve at least some performance.

most_common_vals will (and should) be empty if there aren't actually any
common values, but aren't you getting a histogram?  Exactly what
performance do you think will be improved?

            regards, tom lane

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

Предыдущее
От: Norberto Delle
Дата:
Сообщение: Re: WAL Archiving problem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: WAL Archiving problem