Re: [PERFORM] max partitions behind a view?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PERFORM] max partitions behind a view?
Дата
Msg-id 9918.1505742908@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [PERFORM] max partitions behind a view?  (Rick Otten <rottenwindfish@gmail.com>)
Список pgsql-performance
Rick Otten <rottenwindfish@gmail.com> writes:
> The challenge is that because of an exponential rate of data growth, I
> might have to significantly increase the number of partitions I'm working
> with - to several hundred at a minimum and potentially more than 1000...

> This leads me to the question how many 'union all' statements can I have in
> one view?

I don't think there's a hard limit short of INT32_MAX or so, but I'd be
worried about whether there are any O(N^2) algorithms that would start
to be noticeable at the O(1000) level.

> Should I create a hierarchy of views to gradually roll the data
> up instead of putting them all in one top-level view?

That would likely make things worse not better; the planner would flatten
them anyway and would expend extra cycles doing so.  You could perhaps
stop the flattening with optimization fences (OFFSET 0) but I really doubt
you want the side-effects of that.
        regards, tom lane


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

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

Предыдущее
От: Rick Otten
Дата:
Сообщение: [PERFORM] max partitions behind a view?
Следующее
От: Neto pr
Дата:
Сообщение: Re: [PERFORM] Pageinspect bt_metap help