Re: Postgres partitions-query scanning all child tables

Поиск
Список
Период
Сортировка
От Corey Huinker
Тема Re: Postgres partitions-query scanning all child tables
Дата
Msg-id CADkLM=dYPBgHLtsEzgW+kxepCnyvOeENxvB2rywoEHTW0EDj1A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Postgres partitions-query scanning all child tables  (rverghese <riyav@hotmail.com>)
Ответы Re: Postgres partitions-query scanning all child tables  (rverghese <riyav@hotmail.com>)
Список pgsql-performance
On Thu, Jan 28, 2016 at 1:10 AM, rverghese <riyav@hotmail.com> wrote:
Ok, thanks. Thats a bummer though. That means I need a table for every month/year combination. I was hoping to limit it to 12 tables.

Riya


If you wanted to have a column called month_num or something like that, and if *all* of your queries extract the month date_part() in every where clause, then yes, you could have just 12 tables.

But you won't like that partitioning scheme for other reasons:
- queries that don't "play by the rules" will be slow
- very old data will slow down recent-day queries
- no ability to quickly remove obsolete data by dropping partitions that are no longer useful

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

Предыдущее
От: rverghese
Дата:
Сообщение: Re: Postgres partitions-query scanning all child tables
Следующее
От: rverghese
Дата:
Сообщение: Re: Postgres partitions-query scanning all child tables