July 5, 2011 at 7:14 am
Hi,
I had a performance issue where in the sproc was taking millions of reads. The only modifcation i made was, in the cte within the sproc, i removed the anchore part (which was joining tables and retrieving data) and dumped it in to a table variable, then used the variable as anchore in the CTE. This brought down reads to thousands.
So the big question here is, the anchor only executes once, then why is this making such a big difference?
PFA the exec plans before and after tuning. Scroll down to the CTE part and you ll see the major difference between Before and After is the Concatenation Cost. Why?
Regards - Yasub
July 5, 2011 at 7:34 am
Sorry wrong place for this post , please ignore.
July 5, 2011 at 7:37 am
No replies to this thread please. Direct replies to:http://www.sqlservercentral.com/Forums/Topic1136467-360-1.aspx
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply