ASA SQL User's Guide
Query Optimization and Execution
Query execution algorithms
Sorting algorithms are applicable when the query includes an order by clause, and union algorithms are applicable for union queries.
For more information, see Merge sort and Union all.
Merge sort
Union all
Recursive union
Sort Top N