ORDER BY = Bubble Sort ? Quick Sort ? Insertion Sort ?

  • crmitchell (7/7/2015)


    patrickmcginnis59 10839 (7/7/2015)


    crmitchell (7/7/2015)


    patrickmcginnis59 10839 (7/7/2015)


    crmitchell (3/11/2013)


    Matt Miller (#4) (3/8/2013)


    Besides - all of those sorts methods you mentioned presume a flat list structure. The internals for how tables are structured are anything but flat.

    In short - I suspect the actual answer is "none of the above".

    I'd tend to agree with Matt on this - my suspicion is that it will use a heavily optimised hash table in most circumstances but the only people that can give you a definitive answer would be Microsoft.

    You could try asking on MSDN.

    Ok I'll bite. How do you sort with a hash table? Isn't that the sort of index that you use when you DON'T want sorted / ISAM like access?

    edit: missed the post dates LOL

    You sort the index which holds the hashes to the original table.

    It might return the hashes in sorted order, but you want the original rows in sorted order.

    No, the point of a hash table is that you don't need to change the location of the data on the filesystem. You sort on the key in the hashtable not the hash. The hash is a pointer to the location of the original row

    The result of the query would be the original rows ordered according to the key on the hashtable.

    Its the same principle as a nonclustered index which isn't a covering index but implemented at a lower level

    Ok I think I get it now!

Viewing post 31 (of 30 total)

You must be logged in to reply to this topic. Login to reply