MATRIXX REST APIs for PostgreSQL Partitioning
Use the REST APIs described in this section to manage table partitioning for a PostgreSQL database.
A PostgreSQL table is partitioned into ranges defined by a key column (date range), with no overlap between the ranges of values assigned to different partitions. Each range's bounds are inclusive at the lower end and exclusive at the upper end. For example, if one partition's range is from 1 to 10, and the next partition's range is from 10 to 20, then value 10 belongs to the second partition not the first.
Data is segregated by months so that each month a new partition is created for new data. Partition the ranges based on your specific environment.
A CronJob triggers the creation of partitions using the following APIs:
- setupPartition — Sets up initial partitioning if automatic partitioning fails after deployment.
- showPartition — Shows all partitions for partitioned tables and displays the size in bytes of each partition.
- dropPartition — Purges a partition using the specified date.
- createPartition — Creates a partition using the specified date.
- createNextPartition — Creates the next partition (for example, for the next month).