Обсуждение: Partitioning large table (140GB)

Поиск
Список
Период
Сортировка

Partitioning large table (140GB)

От
Vikas Sharma
Дата:
Hi There,

In our production, we use postgres 9.5 with streaming replication using repmgr, there is a large table of 140GB size which receives lots of inserts,

Is it possible to partition this table in this version of postgres? and if so, please, can someone let me know the best way to accomplish this and the best practices around it?

Thanks & Regards
Vikas

Re: Partitioning large table (140GB)

От
"Ravi Krishna"
Дата:
>In our production, we use postgres 9.5 with streaming replication
>using repmgr, there is a large table of 140GB size which receives
>lots of inserts,
>Is it possible to partition this table in this version of postgres?
>and if so, please, can someone let me know the best way to accomplish
>this and the best practices around it?

In this version only inheritance is possible.  From my experience avoid using
triggers for insert and let the application (if possible) directly write to the
right table.
 
 



Re: Partitioning large table (140GB)

От
Andrei Zhidenkov
Дата:
You can also use extensions like pg_partman or pg_pathman. The last one allows to partition tables smoothly on live
environments.

> On 20. Nov 2019, at 11:49, Ravi Krishna <srkrishna@myself.com> wrote:
>
>> In our production, we use postgres 9.5 with streaming replication
>> using repmgr, there is a large table of 140GB size which receives
>> lots of inserts,
>> Is it possible to partition this table in this version of postgres?
>> and if so, please, can someone let me know the best way to accomplish
>> this and the best practices around it?
>
> In this version only inheritance is possible.  From my experience avoid using
> triggers for insert and let the application (if possible) directly write to the
> right table.
>
>
>
>