hisakimatama (2/24/2014)
Oh yes :-D. There's exactly 217 uses of NOLOCK in that query. I have no idea why. Well, maybe... Considering how long this thing ran, and how mangled it is, there was probably a desperate attempt at hitting the "go faster!" button. Many times. As many as humanly possible. Then a few dozen more. The agony!
And since they are it they might as well skip about half of the dozens and dozens of nearly identical queries to the same table. I mean if the "go fast" button works in some places we should maintain our inconsistency by not using it everywhere. 😀
I feel your pain. I have worked with some systems like that.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/