Problem:
Applications that perform very large SORT operations can often take quite some time to complete the process.
However it is possible to inrease the performance of a SORT application by increasing the amount of memory used by SORT by conguring the SORTSPACE environment variable.
Resolution:
By default, SORT uses 1MB of memory when performing SORT operations. This amount can be increased however by setting the SORTSPACE environment variable to specify a greater amount of memory, for example
SET SORTSPACE=256MB
The more memory you define, the quicker the sort. We found that using the settings below produced the following results when performing a SORT operation against 1 million records:
SORTSPACE TIME TAKEN
2MB 39s
16MB 25s
128MB 25s
256MB 8s
512MB 8s



