Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return just one record for each date
Message
From
06/10/2010 14:46:10
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01484187
Message ID:
01484195
Views:
30
Yes, I guess I did. In the second article I posted execution plans and my results for simulation tests. From the common sense the ORDER BY may take longer than MAX, but in my tests ORDER BY was winning (for that particular test I was doing).

Also, in the comments to the first blog I list two long MSDN threads there I think we did performance testing as well.

I haven't re-visited the issue recently, but packed value solution usually wins performance wise.

Say, re-visited this thread now http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/824546a0-0c03-4af6-86c6-8df9f5381f2b and there ORDER BY solution was the slowest.


Thanks for the info. It's always been my understanding that the ORDER BY is more expensive than the MAX (I just re-compared the 2 execution plans in 2008R2). I'm just not crazy about using ORDER BY in any subquery, but that's just me.
Previous
Reply
Map
View

Click here to load this message in the networking platform