karthik M (3/8/2013)
whereever the optimizer sort the data, it sould use some algorothim to do this operation? Right?
My question is simple, is there any alogrithm used for ORDER BY clause or not by the optimizer?
As I said earlier, the optimiser won't use any algorithm. The optimiser optimises queries, it doesn't run them.
Sure there will be algorithms used for order by (and for every single other operation given the definition of 'algorithm'). Why does it matter which one SQL uses?
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass