In trying to determine what area of a large query i have is causing performance problems i took three steps. Including the execution plan, setting time statistics to on and printing immediately before and after sections that i believe might cause a problem. Example:
print '1'
SELECT ID FROM Test
print '2'
When i look at my execution plan it says that a certain section is taking up a large percentage of the "cost". When I compare this percentage to the elapsed time between my print '1'
and print '2'
it's seems like there is no way that percentage is even close.
Is it a safe bet to rely on the printed values and the time statistics over the estimated cost? If it is, would it make sense for me to focus on areas that have a large elapsed time between printed values rather than the estimated costs?