Enabling multitasking for performance


You can take advantage of the multitasking capabilities in UNLOAD PLUS to improve the performance of your unload jobs.

UNLOAD PLUS determines the most effective arrangement of tasks when the utility runs in a multi-processor environment. Although UNLOAD PLUS runs very efficiently on single-processor computers, it performs even faster on large multi-processor systems. Unloading data from Db2 tables requires several distinct tasks, including sorting and converting data. UNLOAD PLUS can perform these tasks concurrently, reducing the elapsed time of the unload process.

If multiple tasks unload to a single output data set, as in the case of a partitioned table space or multiple table spaces, you can ensure that the contention for the single unload data set does not become detrimental to overall performance. If you are using multiple tasks, we recommend that you use multiple output data sets.

To improve performance and tailor multitasking activities, you can start more than one task per CPU for individual or all processing phases of UNLOAD PLUS. The installation options shown in  Setting installation options for optimal performance in UNLOAD PLUS, when used together, can be set to maximize the number of tasks that UNLOAD PLUS uses.

Limitations on multitasking

The following conditions limit the ability of UNLOAD PLUS to multitask:

  • When you specify ORDER YES and you are unloading a table-controlled partitioned table space with a clustering index, UNLOAD PLUS uses a single task when either of the following conditions exists:

    • The clustering key does not match or is not a subset of, the partitioning key.
    • The clustering index is not partitioned and the clustering key is a subset of the partitioning key.

    This restriction does not apply when you specify ORDER YES BYTASK.

  • When you specify ORDER BY and either of the following conditions exists, UNLOAD PLUS sets MAXSORTS to 1 and assigns all partitions to a single task:
    • The columns that you specify in the ORDER BY option are different from the partitioning index key columns.
    • The columns that you specify in the ORDER BY option are the same or a subset of the partitioning index key columns but are in a different order.
  • When you specify ORDER YES or ORDER BY and you are unloading a partition-by-growth table space, UNLOAD PLUS uses a single task.
  • When you specify LE COBOL, COBOL II, C, or LE C user exit routines, UNLOAD PLUS sets MAXSORTS to 1.
  • When unloading to a BatchPipes file, you must set MAXSORTS or MAXCONNECT to 1.

Unloading from LOB or XML table spaces

To optimize multitasking when you are unloading LOB or XML data and DIRECT YES is in effect, unload to multiple referenced files and specify the SUBSETS option on the OUTPUT statement for the referenced files. When UNLOAD PLUS allocates multiple data sets, a separate LOB or XML table space subtask unloads to each data set. For more information, see SUBSETS.

Unloading from multiple table spaces

When you unload from multiple table spaces, UNLOAD PLUS first optimizes the arrangement of tasks for each partitioned table space so that it can unload with multiple tasks. UNLOAD PLUS then determines the most effective arrangement of tasks for the remaining nonpartitioned table spaces, assigning one table space per task.

If you are unloading from multiple table spaces, we recommend that you use multiple unload data sets to reduce contention that could impact performance.

Unloading from multi-table segmented table spaces

UNLOAD PLUS processes only those segments that pertain to the tables that it is unloading. The utility optimizes the processing of tables in a multi-table segmented table space. UNLOAD PLUS does not read data in tables that you did not specify in the selection criteria.

Using multiple unload data sets

When you unload a partitioned table space with a single SELECT statement, we recommend that you use one unload data set per partition unless the number of partitions being unloaded exceeds the maximum threshold. When you unload from multiple table spaces, use one unload data set per SELECT statement. Using multiple unload data sets in these cases enables UNLOAD PLUS to achieve maximum throughput and minimum elapsed time. To obtain the best results, put each unload data set on a different DASD volume. This precaution produces the least amount of interference between multiple tasks and ensures the smallest elapsed and CPU time. For more information, see Using JCL to specify multiple unload data sets.

In general, UNLOAD PLUS opens all unload data sets at the same time. This processing requires sufficient region size and tape devices to execute.

When you specify the FILTERPART YES option, however, the only data sets that UNLOAD PLUS opens are data sets for the unloaded partitions. UNLOAD PLUS dynamically eliminates the processing of partitions that do not meet the conditions of the WHERE clause.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

UNLOAD PLUS for DB2 13.1