pg_partman icon indicating copy to clipboard operation
pg_partman copied to clipboard

Support of Pg_partman for Hash Partition

Open maheshetty20 opened this issue 3 years ago • 3 comments

Hello Team,

We are planning to partition an existing huge table (800gb) using Hash Partition as they Key column is UUID. Wanted to understand does Pg_partman supports Hash Partiton. We are on PG Aurora.

Thanks in Advance.

maheshetty20 avatar Aug 25 '22 09:08 maheshetty20

pg_partman does not support hash partitioning at this time. The main utility of pg_partman right now with native partitioning is ongoing maintenance (making new tables and retention of dropping old ones). Generally hash partitioning is a one-time setup and the number of child tables is fixed, so it doesn't help much there.

However, I do have an issue open to investigate adding it as part of support in sub-partitioning, which would likely mean adding support for it in general. I do not have an ETA for that at this time - https://github.com/pgpartman/pg_partman/issues/346

keithf4 avatar Aug 26 '22 14:08 keithf4

Thanks for the clarification. We are in a process of migrating Aurora PG table(800GB) to partitioned table. We are tried with below approach but it is never ending and continuously running. "Insert into Partitioned table select * from 800GB table." From your expertise can you suggest some best approach with reduced down time.

maheshetty20 avatar Aug 26 '22 15:08 maheshetty20

You can take a look at some of the techniques in this document. While it's specific to using pg_partman, the methods of batching and making the original table the default of the new one can be applied anywhere.

https://github.com/pgpartman/pg_partman/blob/master/doc/pg_partman_howto_native.md

keithf4 avatar Aug 26 '22 16:08 keithf4

Closing this issue for now since there is already another one open for hash partitioning support

keithf4 avatar Nov 29 '22 18:11 keithf4