Parallel Background Processes
Many processes have been designed to run in parallel in order to speed execution. This is referred to as running the process with multiple “threads”.
The system provides the following strategies for distributing the data to the multiple threads.
-
Thread Level SQL Select (THDS). This strategy is sometimes referred to as the “thread iterator” strategy. In this strategy, the batch job uses the primary key to figure out how to evenly distribute key ranges to each thread. Each thread is then responsible for selecting the records. In this strategy, the threads should also re-select the data periodically to release the cursor, which aids in performance. Note that this strategy is preferred but may only be used under the following conditions:
- The data from only one maintenance object is being processed.
- The primary key for the maintenance object is a single, numeric system generated key.
Note:Parameters may be used to override the low and high id. Refer to Parameters Supplied to Background Processes for more information. -
Key Ranges (KEYS). This strategy is similar to the Thread Level SQL Select strategy, and follows the same maintenance object and prime key conditions, but uses actual key values to calculate thread ranges. Such strategy may be needed in situations where keys do not evenly distribute across threads, resulting in uneven thread completion times. For example, conversion entities in the staging schema have legacy keys, which are typically not evenly assigned. This impacts the Object Validation and XML resolution batch processes that thread by legacy keys.Note:This strategy should not be widely used and as such is only supported by the Monitor and Ad-hoc Plug-in Driven batch programs.
-
Job Level SQL Select (JOBS). This strategy is sometimes referred to as the “standard commit” strategy. In this strategy, the keys for the records to be processed by the batch job are all selected first and stored in a temporary table. The batch job then supplies each thread with a range of keys that it should process. This strategy is used if multiple maintenance objects are being processed by the batch job; if the primary key of the maintenance object has multiple parts or if the primary key is non-numeric.
The multi-threading logic relies on the fact that primary keys for master and transaction data are typically system generated random keys. In addition, if the data is partitioned, it is expected to be partitioned based on the primary key.