One way to work around this problem, which works well when complex records (such as in a relational database) are being sorted by a relatively small key field, is to create an index into the array and then sort the index, rather than the entire array. (A sorted version of the entire array can then be produced with one pass, reading from the index, but often even that is unnecessary, as having the sorted index is adequate.) Because the index is much smaller than the entire array, it may fit easily in memory where the entire array would not, effectively eliminating the disk-swapping problem. This procedure is sometimes called "tag sort".
one way to work around this problem which works well when complex records (such as in a relational database) are being sorted by a relatively small key field is to create an index into the array and then sort the index rather than the entire array (a sorted version of the entire array can then be produced with one pass reading from the index but often even that is unnecessary as having the sorted index is adequate) because the index is much smaller than the entire array it may fit easily in memory where the entire array would not effectively eliminating the disk-swapping problem this procedure is sometimes called "tag sort"