QEF Sort Enhancements
QEF was improved by fine-tuning the sort algorithm, resulting in fewer comparisons between sort rows. The sort algorithm is a major consumer of CPU time in a sort. QEF was also improved with a change that results in the rows being partially sorted as they arrive in the sort.
This change introduces two distinct benefits:
• Duplicate rows are detected and discarded more quickly from duplicate removal sorts (as required by “select distinct...”). This in turn increases the number of rows that can be processed in memory for a duplicates removal sort, avoiding more expensive disk sorts in many instances.
• The first rows in the sort sequence can be returned before the remaining rows are completely sorted. Tests show that the first sorted row is available with as few as 20% of the overall comparisons required to complete the sort. This means that browsing or scrolling applications see the first set of rows in less time than before.