Assume that the input link contains 100,000 rows of data, and Max Rows in Virtual Memory is set to 10,000 rows.
The sort algorithm reads in the first 10,000 rows from the input link, performs an intermediate sort, then stores the sorted data to a temporary file. The algorithm continues to group 10,000-row chunks from the input link, storing the sorted results in unique temporary files, until one of the following conditions is met:
After the intermediate sorts, the 10 temporary files are merged and sorted together, resulting in the final sort that is written to the output link.
If, for example, Max Open Files is set to 5, the first 50,000 rows are processed as five temporary files, with 10,000 rows each. These temporary files are merged together to form a new temporary file with 50,000 rows of sorted data. The algorithm grabs the next 10,000 rows from the input link and continues with the intermediate sorts. This algorithm continues recursively until all the data is processed.