Record distribution and high key partitioning

If you use key range partitioning, you can change the distribution of records across HALDB partitions by changing the high key of one or more partitions. The high key of a partition specifies the highest root key of a record that a partition can contain.

The high key of a partition also defines the boundary between the partition that owns the high key and the partition with the next higher high key, if such a partition exists. If you change a high key that defines a boundary between two partitions, both partitions are affected by the change. For example, lowering a high key of a partition usually reduces the number of records in the partition that owns the high key and increases the number of records in the partition with the next higher high key.

Before you adjust the distribution of records in your HALDB database:
  • Analyze the current distribution of records across the partitions in the HALDB database.

    For an accurate report of the records in an existing HALDB database, you can use the IBM® IMS HALDB Toolkit for z/OS®, a separately licensed software tool. For more information about the tool, see the information about IMS Tools in the IBM Documentation.

  • Enable the HALDB reorganization number verification function, which prevents the reorganization numbers of partitions from being regressed by the movement of records between partitions.

You can change the high key of a partition by using either the Partition Definition utility or by using DBRC batch commands. These changes generally require that you unload the affected partitions before changing the partition definitions, and then initialize and reload the partitions when you are done making changes. An affected partition is any partition whose range of keys has increased or decreased, even if you did not directly change the definition of the partition.

You typically change the high key of a partition when the amount of data in a HALDB database is not balanced from one partition to the next. Changing a high key of a partition changes the boundary of the partition and causes some records to be moved from one partition to another.

The following figure shows the change of the high key for partition B from 400 to 500, which results in the movement of records with keys from 401 to 500 from partition C to partition B.

Figure 1. Changing a high key with key range partitioning

The change to the high key of partition B in the previous figure is therefore a change that affects both partition B and partition C. When the definition of partition B is changed, IMS flags both partition B and partition C as requiring initialization. Partitions A and D are not affected by the change.

Note that the online IMS system is not aware of the changes to the partition definitions of partitions B and C in the previous figure until one of the following events occurs: