A query is known to return 500,000 rows. Which two are recommended to process all 500,000 rows efficiently? (Select two)
Correct Answer: B,C
Processing extremely large datasets-such as 500,000 rows-presents significant challenges for memory management and transaction stability in Guidewire. To handle this efficiently, developers must use the Gosu Query API correctly and choose the right execution context.
The first best practice is the use of setPageSize() (Option B). When a query is executed, by default, the system might attempt to fetch a large number of rows into the application server ' s memory. By calling setPageSize (50) or setPageSize(100) on the query object, the developer instructs the database driver to fetch only a small
" page " of records at a time. This keeps the memory footprint of the Gosu bundle low and prevents OutOfMemory errors, even though the developer can still iterate through the entire 500,000-row result set as if it were a single collection.
The second best practice is to move such a heavy operation into a Batch Process (Option C). Executing a
500,000-row loop within a UI request or a standard rule would likely cause a web server timeout or block other threads. A Batch Process runs in the background, has its own dedicated work queue, and can be configured to " checkpoint " its progress. This means if the server restarts, the batch process can potentially resume where it left off.
Options like sorting (Option E) can actually hinder performance on large sets if the database index is not optimized for that sort. " Chunking " (Option D) is conceptually similar to paging, but setPageSize() is the specific, built-in method provided by the Guidewire Query API to achieve this.