Chapter Contents

Previous

Next
SAS Companion for UNIX Environments

Setting the SORTSIZE System Option

To make the best use of your machine, the SORTSIZE option should be set to a value large enough so that the entire data set, plus quick sort's overhead, can be held in memory. This value is given by the following expression:

sortsize = n * (s + k + 4) 
where
n is the number of rows in the data set.
s is the size of a row in bytes.
k is the size of the sort key in bytes.

For example, consider a data set with 100,000 eighty-byte rows that is being sorted on an eight-byte numeric variable. The sort runs fastest if the value of the SORTSIZE option is set to the value 100000 * (80 + 8 + 4).

 options sortsize = 9200000; 
If the entire problem cannot be held in memory, the quick sort procedure performs a number of individual sort steps, each one as large as the value of the SORTSIZE option permits, and saves the results on disk. After all data has been sorted, the individual sorted collections are merged to produce the final sorted data set. In this case, parallel quick sort may offer no performance advantage.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.