In OpenEdge partitioning, two ways of creating a partition policy and partition policy details for a table are: using the Administration Console and using the ABL API for Table Partition Management. Even if you already know how to use the ABL API, it is recommended that you first use the Console to create one partition policy and at least one partition policy detail. You then generate a partition policy program as a template that you can modify to create partition policies and partition policy details for other tables you want to partition using the ABL API. In this demonstration, we will show you how to create a partition policy and partition policy details using the Database Administration Console. Assume that we have created a new partitioned table, tpInvoice, with a number of fields. We have also created a primary unique global index, InvoiceNumGlobalIdx, based on the InvoiceNum field, and a local index, InvoiceDateLocalIdx, based on the InvoiceDate field. Now, we are ready to create a partition policy, tpInvoice, by range and three associated partition policy details, tpInvoice_1999, tpInvoice_2009, and tpInvoice_2019, for the tpInvoice table. We start by clicking Database Administration > Database Connections from the Database Administration Console. A new Database Administration tab appears, with the left pane showing the sportsco database connection. We click the sportsco database connection. The right pane displays five sections of information about the database, including the Storage Management section. From the Storage Management section, we click Create partition policy. The Create Table Partition Policy wizard appears. We enter tpInvoice as the policy name. In the Database connection field, we retain the database connection name. In the Table field, we click the Search icon and select tpInvoice from the Table Selection dialog box. For the Default data area field, we click the Search icon and select tpInvoiceData1 as the storage area name from the Area Selection dialog box. For the Default index area field, we select tpInvoiceIndex1. For the Default LOB area field, we select tpInvoiceData1. We select Immediate – set new partitions to allocate space as an object allocation rule because we want to allocate space globally to the new partitions when we create them by adding partition policy details to the partition policy. Then we click Next. Since we partition by range, we select the Has range check box. Note that if we were partitioning by list, we would simply skip this check box. In the Partition fields area, we click Add fields from index and select InvoiceDateLocalIdx from the Index Selection dialog box. The InvoiceDate field is added to the Partition fields area. Notice that the InvoiceDateLocalIdx index is automatically added to the Partition aligned indexes area. This is the local partition-aligned index we use to create this partition policy. We click Next and then click Load Details. Note that there are no records in the table because tpInvoice is a new partitioned table. We click Finish to save the partition policy. The Table Partition Policies page appears.

Copyright © 2014 Progress Software Corporation. All rights Reserved.

Next, we will create three partition policy details, tpInvoice_1999, tpInvoice_2009, and tpInvoice_2019, for the tpInvoice partition policy. We click Edit Details in the Action of the tpInvoice partition policy to create partition policy details. The Edit Partition Policy Details page appears. We click Add to add a new partition policy detail. A new is added to the partition policy details table. In the Name/Description column, we type tpInvoice_1999 as the partition name. In the Values column, we type 1999-12-31 as the upper bound of the partition. As a result, the predicate InvoiceDate LE 1999-12-31 is used, which means that all invoice records whose invoice dates are less than or equal to this date will belong in this partition. Note that if we were partitioning by list, we would do the same thing here and specify a valid column value. The difference is that the predicate would use the comparison operator EQ, which means that all records whose column values match the specified value would belong in the partition. Note also that since we selected Immediate – set new partitions to allocate space as an object allocation rule when we defined the partition policy, the Allocated check box is already selected. By default, for each partition the Data, Index, and LOB default areas are inherited from the parent partition policy. Here, we will spread the partitions across different physical areas to help reduce disk I/O contention and enhance performance. We click the Search icon and select tpInvoiceData2 as the default data area field. Then, we select tpInvoiceIndex2 as the default index area field and tpInvoiceData2 as the default LOB area field. We click Update to apply the changes for this partition. We repeat these steps to create the remaining two partition policy details. Finally, we click to save the partition policy details for the tpInvoice partition policy. We have now created a partition policy and partition policy details using the Database Administration Console. At this point, we can continue to use the Database Administration Console to add more partition policies and partition policy details. Or we can use the Database Administration Console to generate a partition policy program as a template that we can modify to create partition policies and partition policy details for other tables using the ABL API. You can learn about creating a partition policy and partition policy details using the ABL API in the next video, “Creating a partition policy and partition policy details using the ABL API.” For more information about OpenEdge table partitioning, take the Implementing Progress OpenEdge Table Partitioning course.

Copyright © 2014 Progress Software Corporation. All rights Reserved.