Question on moving data to new partitions

Поиск
Список
Период
Сортировка
От Benjamin Krajmalnik
Тема Question on moving data to new partitions
Дата
Msg-id F4E6A2751A2823418A21D4A160B68988613D50@fletch.stackdump.local
обсуждение исходный текст
Ответы Re: Question on moving data to new partitions  (Scott Marlowe <scott.marlowe@gmail.com>)
Re: Question on moving data to new partitions  (Dimitri Fontaine <dfontaine@hi-media.com>)
Список pgsql-admin

I have some tables which have an extremely high amount of update activity on them.  I have changed autovacuum parameters (cost delay and limit), and whereas before they would never be vacuumed and bloat they are running fine.

However, as the platform scales, I am afraid I will reach the same situation.

As a result, I have decided to partition the table and add to each record a partition id, which can be used to route it to the correct partition.

Presently, all of the records reside on what will ultimately become the parent partition.

What would be the best way of moving the data to the pertinent partitions?

I was thinking of copying the data to another table and then performing a insert into partitionedtableparent select * from temporary table, and then performing a delete from only partitionedtableparent.

Does this sound like a reasonable way of doing this?  Is there a more efficient way of doing this?

 

 

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

Предыдущее
От: "J. Hondius"
Дата:
Сообщение: Oops! Disaster recovery
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Question on moving data to new partitions