Re: Why is n_distinct always -1 for range types?

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Why is n_distinct always -1 for range types?
Дата
Msg-id CAEYLb_Vi4=BVZ1TvSzO2vZSSkCd3p83StO8dcSuRHHymaOpkTg@mail.gmail.com
обсуждение исходный текст
Ответ на Why is n_distinct always -1 for range types?  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-performance
On Thu, Sep 19, 2013 at 1:47 PM, Josh Berkus <josh@agliodbs.com> wrote:
> 4. n-distinct will still be listed as -1 (unique) for the column.
>
> Why?


Because of this:

https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/rangetypes_typanalyze.c#L205

We only collect and use histograms of lower and upper bounds for range
types, and the fraction of empty ranges.

--
Regards,
Peter Geoghegan


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Planner performance extremely affected by an hanging transaction (20-30 times)?
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: Planner performance extremely affected by an hanging transaction (20-30 times)?