|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, July 26, 2011 9:41 AM
Points: 3,
Visits: 7
|
|
If you don't see the DB called AdventureWorks2008R2 then it is because you don't have FILESTREAM installed/running. Go here and follow the instructions.
http://msftdbprodsamples.codeplex.com/releases/view/59211
(can you tell I did this already too )
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, July 26, 2011 9:41 AM
Points: 3,
Visits: 7
|
|
First off, I would like to say good job, I don't think most of us appreciate the hard word that goes into these articles.
The only item I will nit-pick is the use of the function with the "customerid" being passed it. Appreciating that with the amount of data you have the difference is negligible, I have had to fix way too many of these since functions came into being in SQL 2000.
To your yoda quote "you must unlearn what you have learned", inside a function if you need to select as you do from a table you have effectively created the very cursor you are trying to avoid since SQL will call the function row by row with 1 ID at a time. The queries will generally scale better with more liberal use of temp/variable tables although they also have their limits. However what is the worst thing about the functions is that they are hidden in the execution plans, which can make them a real bugger to find sometimes.
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 4:07 PM
Points: 1,943,
Visits: 8,227
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, July 26, 2011 9:41 AM
Points: 3,
Visits: 7
|
|
hhmmm....interesting that the optimizer treats them differently, I will have to get a closer look at that, thanks for the info.
D
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Friday, August 10, 2012 4:18 PM
Points: 19,
Visits: 15
|
|
| Just a typo I noticed, in a few of your performance result tables, the actual percentage between run 2 and 3 looks to be inverted (17 and 22 instead of 22 and 17)
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: 2 days ago @ 8:08 PM
Points: 61,
Visits: 616
|
|
|
|
|