5.5.3. Partitioned Sort

<< Click to Display Table of Contents >>

Navigation:  5. Detailed description of the Actions > 5.5. Standard >

5.5.3. Partitioned Sort

 

Icon: clip0141

 

Property window:

 

clip0143

 

Short description:

Sort the input table, partition-by-partition.

 

Long Description:

Sort the input table, partition-by-partition. A partition is a set of contiguous rows inside the input table. The end of a partition (i.e. the last row of a partition) is marked by a change of value inside the “partitioning variable” (i.e. The partitioning variable is constant inside one partition).

 

For example:

 

clip0142

 

The algorithm is the following:
 

1.Anatella loads into an in-memory RAM buffer a whole partition.
 

2.Anatella sorts the in-memory RAM buffer.
 

3.Anatella outputs each row of the (sorted) buffer.
 

4.Anatella clears the buffer and, if there are some more input rows (i.e. some more partitions), it goes back to step 1.

 

The size of the in-memory RAM buffer automatically increases to be able to store a whole partition. The size increment is given here:
 
clip0144
The memory consumption of the clip0141 Partitioned Sort Action is equal to the amount of RAM memory required to store the largest partition.

 

 
In the general case, the output table does not contain any sort-meta-data (to indicate that the output table is, in the general case, not sorted), unless we are in the following “special” case: If the most significant sort-variable of the input table is equal to the partitioning-variable, then the sort-meta-data of the output table is set to the following:
 

The most significant sort-variable of the output table is equal to the partitioning-variable.

The other less-significant sort-variables are set accordingly to the sorting parameters of the clip0141 Partitioned Sort Action.

 

 

The clip0141 Partitioned Sort Action can run inside a N-Way Multithread Section only if the partitioning variable of the N-Way Multithread Section is equal to the partitioning variable of the clip0141 Partitioned Sort Action. When executing a clip0141 Partitioned Sort Action using N CPUs, the RAM memory consumption is multiplied by N.