XSM Sort / Merge Discussion

This article explains the use of sorting / merging operations.

SORT / MERGE = MERGING with implicit SORT


Sorting records from one or more input files will produce 1 set of all records sorted, according to the sort keys you specified.

If you specify several input files in the sort operation, the sort operation will merge the records automatically while sorting.
That is, you don't have to specify MERGE operation ; it is implicit.

Considering the number of files you can sort or merge within one single operation, the Operating System has its own limits, and your System Administrator can set user quotas.

XSM is built to process 1024 files simultaneously.
(If this is not enough for you, please contact us, we will re-compile with higher MAX_FILE)




See below MERGE operation

               


MERGE ONLY = MERGING pre-sorted files


Merging records from several input files will produce 1 set of all records sorted, according to the sort keys you specified.

It is assumed that input files are pre-sorted, otherwise the operation fails.

Thus, MERGE operation should only be used when your input files are already sorted according to your sort keys.

MERGE operation is faster than SORT + MERGE operation.
But SORT (that is SORT + implicit MERGE) operation is faster than SORT operation followed by MERGE operation.