Deleting the partition with the lowest key and all of its records

In some cases, it might be useful to delete a partition that has the lowest key range along with all of the records the partition contains.

Such a case might arise if the keys in a HALDB database are based on time or an ascending value. As the key values increase, you can delete a partition that has become empty or whose records are no longer of interest.

For example, in the following figure the key for the database is based on time. The high order part of the key contains the year and there is a partition for each year. In this example, partition A with a high key of 2005zzz is no longer needed. Either all of its records have been deleted or they are no longer needed. In fact, this is an efficient way to delete all the records in partition A. Because no records are moved either to or from any other partitions, no other partitions are affected. No partitions need to be unloaded, reloaded, or initialized. There is only one step in the process: to delete partition A.

Figure 1. Deleting the partition with the lowest key in a HALDB that uses key range partitioning
Begin figure description: partitions A through D are shown left to right at the top of the figure. At the bottom of the figure the same series of partitions includes only B through D. Partition A and all of the records in partition A have been deleted. End figure description.