Active and Inactive Partitions

The Tuple Mover assumes that all loads and updates to a partitioned table are targeted to one or more partitions that it identifies as active. In general, the partitions with the largest partition keys—typically, the most recently created partitions—are regarded as active. As the partition ages, it commonly transitions to a mostly read-only workload and requires much less activity.

The configuration parameter ActivePartitionCount determines how many partitions are active for each partitioned table in the database. By default, ActivePartitionCount is set to 1, so the Tuple Mover assumes that only one partition—the newest one—is active. For example, if a table is partitioned by month, the Tuple Mover expects that after the start of a new month, all activity on that table is directed at the new month's partition.

If loads and updates frequently occur to multiple partitions, you can adjust the ActivePartitionCount parameter accordingly. For example, if your database receives data for the current month as well as updates to the prior month, set ActivePartitionCount to 2. For tables partitioned by non-temporal attributes, set ActivePartitionCount to reflect the number of partitions that are loaded simultaneously.

The Tuple Mover uses the following algorithm to determine which partitions are older than others:

  1. If one partition was created before the other partition, it is older.
  2. If two partitions were created at the same time, but one partition was last updated earlier than the other partition, it is older.
  3. If two partitions were created and last updated at the same time, the partition with the smaller key is considered older.

Active Partition Groups

If a table's partition clause includes a GROUP BY expression, Vertica applies ActivePartitionCount to the largest partition group key, and regards all the partitions in that group as active. If you group partitions with Vertica meta-function CALENDAR_HIERARCHY_DAY, the most recent date partitions are also grouped by day. Thus, the largest group key and largest partition group key are identical. In effect, this means that only the most recent partitions are active.

For more information about partition grouping, see Partition Grouping and Hierarchical Partitioning.