Re: Recommendations for partitioning?

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: Recommendations for partitioning?
Дата
Msg-id CAOR=d=3Et_2VBd9aVRtwDAiHzy+c0f0B3ur+-MfUAStMrpXsEg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Recommendations for partitioning?  (Dave Johansen <davejohansen@gmail.com>)
Ответы Re: Recommendations for partitioning?  (Dave Johansen <davejohansen@gmail.com>)
Список pgsql-performance
On Thu, Dec 19, 2013 at 9:53 AM, Dave Johansen <davejohansen@gmail.com> wrote:
>>
> On Sat, Dec 7, 2013 at 1:37 PM, Scott Marlowe <scott.marlowe@gmail.com>
> wrote:
>> I'll add that you can use assymetric partitioning if you tend to do a
>> lot of more fine grained queries on recent data and more big roll up
>> on older ones. I.e. partition by month except for the last 30 days, do
>> it by day etc. Then at the end of the month roll all the days into a
>> month partition and delete them.
>
> This sounds like a great solution for us. Is there some trick to roll the
> records from one partition to another? Or is the only way just a SELECT INTO
> followed by a DELETE?

That's pretty much it. What I did was to create the new month table
and day tables, alter my triggers to reflect this, then move the data
with insert into / select from query for each old day partition. Then
once their data is moved you can just drop them. Since you changed the
triggers first those tables are no long taking input so it's usually
safe to drop them now.


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

Предыдущее
От: Dave Johansen
Дата:
Сообщение: Unexpected pgbench result
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Re: Problem with slow query with WHERE conditions with OR clause on primary keys