A_SORT_REGIONS

This configuration variable can be used in conjunction with the A_SORT_REGIONS_FINAL configuration variable to configure sort operations to run using a process that uses significantly fewer I/O operations that other traditional sort operations. This method is suited to sort operations on large files.

Unless you can set the SORT_MEMORY variable to allocate enough memory in which to load all required records, a sort operation must use a temporary sort file. Within a temporary file, records are sorted and stored in regions. A_SORT_REGIONS determines how those sorted regions are merged together.

Set A_SORT_REGIONS to 0 for a sort method that passes through the temporary file once. This method performs less file I/O, because it only writes the records to the temporary file once. However, the file I/O is more random in nature and more CPU time is used in order to manage this file access. This method produces better results when the temporary sort file is stored on a relatively slow storage device, such as a mechanical disk drive.

The alternative is to set A_SORT_REGIONS to a value between 2 and 64, in which the sort process makes multiple passes through the regions, merging the number of regions set by this variable on each pass; the merge takes place in an additional temporary sort file. This method results in more I/O operations, but requires less CPU time because the operations are highly sequential. This method produces better results when the temporary sort files are stored on a relatively faster storage device, such as a solid-state disk drive.

The default for this variable is 4; therefore the 2nd method described here is the default method.

An additional variable can be set when using the default method; see A_SORT_REGIONS_FINAL for more information.