Home Forums SQL Server 2008 T-SQL (SS2K8) ORDER BY = Bubble Sort ? Quick Sort ? Insertion Sort ? RE: ORDER BY = Bubble Sort ? Quick Sort ? Insertion Sort ?

  • The optimiser is the wrong term for this, it's not the query optimiser that performs sorts.

    The Query Engine obviously uses algorithms to perform sorts. Those algorithms are proprietary and undocumented, but you'd imagine them to be based on some of the better performing sorting mechanisms above, tweaked and changed for SQL's internal storage characteristics, index usage, parallelism, statistics, etc.