Improving performance with bulk processing
Improving performance with bulk processing
Getting started
This document provides instructions on how to avoid processing of large sets of results which uses a lot of system resources causing performance issues. Iterative approach helps to achieve same goal without impacting system resources.
Implementing iterative approach with Report definitions and Obj-Browse improves query performance and reduces memory footprint.
Example
A user wants to update 500 000 eligible cases in a nightly batch job with One time utility. Retrieving that high number of records directly degrades application performance.
Steps
Design Option One:
The following approach works for both activity Obj-Browse method and Report Definitions.
- Define hasMore parameter and set to true before calling Obj-Browse or Report Definition.
- Start looping by using loop option in activities, and configure precondition for that step.
- Obj-browse or Report Definition should use any unique numeric property that is sorted by the ascending order.
- You can do business logic after this step on the results set. Once business logic is done at the end, set values Param.hasMore based on pxMore from Resultset page and set last processed id.
Note: The pxMore is set by Pega to true if there are more records left for your query. That is indication for system to continue the loop. When there are no records left, loop precondition fails, and the step is exited.
Design Option Two:
The following approach works only with Report definition.
- Set Dynamic pagination values for Report Definitions.
- Call report definition in the loop.
- Set the the HasMore parameter value to false when page count matches with current page.
Results
It helps to improve overall application performance and can avoid exceptions and timeout issues with DB queries.