AutoPartition in PGD v6.0.2
PGD AutoPartition allows you to split tables into several partitions. It lets tables grow easily to large sizes using automatic partitioning management. This capability uses features of PGD, such as low-conflict locking of creating and dropping partitions.
You can create new partitions regularly and then drop them when the data retention period expires.
You perform PGD management primarily by using functions that can be called by SQL.
All functions in PGD are exposed in the bdr schema. Unless you put it into
your search_path, you need to schema qualify the name of each function.
Auto creation of partitions
PGD AutoPartition uses the bdr.autopartition()
function to create or alter the definition of automatic range partitioning for a table. If
no definition exists, it's created. Otherwise, later executions will alter the
definition.
PGD AutoPartition in PGD 5.5 and later leverages underlying Postgres features that allow a partition to be attached or detached/dropped without locking the rest of the table. Versions of PGD earlier than 5.5 don't support this feature and lock the tables.
An error is raised if the table isn't RANGE partitioned or a multi-column partition key is used.
By default, AutoPartition manages partitions locally. Managing partitions
locally is useful when the partitioned table isn't a replicated table. In that
case, you might not need or want to have all partitions on all nodes. For
example, the built-in bdr.conflict_history
table isn't a replicated table. It's managed by AutoPartition locally. Each node
creates partitions for this table locally and drops them once they're old
enough.
Also consider:
Activities are performed only when the entry is marked
enabled = on.We recommend that you don't manually create or drop partitions for tables managed by AutoPartition. Doing so can make the AutoPartition metadata inconsistent and might cause it to fail.
AutoPartition examples
Daily partitions, keep data for one month: