Partitioning scheme

The partitioning scheme of a message audit log is defined by:
  • The number of partitions
  • The type of the partition indicator column
  • The columns to be included into the partitioning index
  • The key range of the partitions, which must be specified in the partitioning index
When the partition indicator is properly included in the partitioning index, the partitioning scheme has the following characteristics:
  • Each partition contains the log entries of a certain time range
  • At any time, only one partition or a subset of partitions is active, that is, is engaged in recording messages
  • Partitions are reused periodically
For example, assume that the partitioning scheme is defined as follows:
  • The partition indicator type is dow (day of week)
  • The message audit log is subdivided into seven partitions, with a separate partition for each day of the week from Monday to Sunday.
Figure 1. One partition per day of the week. Partition Indicator type=dow, or Partition Indicator type=userwith Days per partition= 1 and Partitions per Cycle= 7. The values of Pi can be interpreted as values of the partition indicator or as partition numbers.
Figure showing one partition per day of the week

The resulting partitioning scheme is shown in Figure 1. DB2® records the messages from Monday in one partition, the messages from Tuesday in another partition, and so on. The following week the partitions are reused. This example also shows that the partitions should be archived or cleared regularly, so that DB2 can switch to clean partitions in a new usage cycle.

When you plan the partitioning scheme you can either accept the default partitioning scheme or design your own custom partitioning scheme.