Re: Multidimensional Histograms

Поиск
Список
Период
Сортировка
От Andrei Lepikhov
Тема Re: Multidimensional Histograms
Дата
Msg-id 2ba586f7-ae89-4255-bb6e-37af0808b413@postgrespro.ru
обсуждение исходный текст
Ответ на Re: Multidimensional Histograms  (Alexander Cheshev <alex.cheshev@gmail.com>)
Список pgsql-hackers
On 8/1/2024 16:21, Alexander Cheshev wrote:
> Hi Andrei,
> 
>> Maybe my wording needed to be more precise. I didn't implement
>> multidimensional histograms before, so I don't know how expensive they
>> are. I meant that for dependency statistics over about six columns, we
>> have a lot of combinations to compute.
> 
> Equi-Depth Histogram in a 6 dimensional case requires 6 times more
> iterations. Postgres already uses Equi-Depth Histogram. Even if you
> increase the number of buckets from 100 to 1000 then there will be no
> overhead as the time complexity of Equi-Depth Histogram has no
> dependence on the number of buckets. So, no overhead at all!

Maybe. For three columns, we have 9 combinations (passes) for building 
dependency statistics and 4 combinations for ndistincts; for six 
columns, we have 186 and 57 combinations correspondingly.
Even remembering that dependency is just one number for one combination, 
building the dependency statistics is still massive work. So, in the 
multicolumn case, having something like a histogram may be more effective.

-- 
regards,
Andrei Lepikhov
Postgres Professional




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

Предыдущее
От: "Andrey M. Borodin"
Дата:
Сообщение: Re: [PATCH] Add sortsupport for range types and btree_gist
Следующее
От: Andrei Lepikhov
Дата:
Сообщение: Re: Custom explain options