Why does an optimized query takes the same elapsed time as the original query?
Posted on 2007-11-27
I have a complex querey that I have optimized (mostly with indexed views)
Before: EstimatedCPU=34, EstimateRows=2547409, TotalSubtreeCost=42,47
After: EstimatedCPU=19, EstimateRows=1307739, TotalSubtreeCost=19,48
Why do I get the same elapsed time for both queries (before and after version takes 7 seconds) while I am alone on a test machine?
One thing to note however is the statistics produced by the option "set statistics time on" are consistent with the elapsed time. That is it reports around 7000 ms for each query. Thta is the timing I get from SQL Management studio.