Link to home
Start Free TrialLog in
Avatar of marrowyung
marrowyung

asked on

CPU intensive query#2

Dear all,

I found out some SQL queries that make the CPU hight, tempdb usage hight and I dont' know how to solve, please comment.

FROM #VendorDD dd 				
JOIN @CountryCode cc ON dd.CountryCode = cc.CountryCode				
LEFT JOIN #DDRoot r1 ON dd.DialedDigits = r1.DD				
LEFT JOIN #DDRoot r2 ON dd.DestinationID = r2.AttributesID 				-- 2004.10.25 sg #7148-#7149
WHERE r1.DD IS NULL				
AND r2.AttributesID IS NULL				
AND	@EffDate BETWEEN dd.BeginDate AND ISNULL(dd.EndDate, @EffDate)
.....

.
			

Open in new window


now the in the execution plan, what I can see the high cost is 2 x table scan, so how to solve it?

execution plan:

User generated image
User generated image
ASKER CERTIFIED SOLUTION
Avatar of PortletPaul
PortletPaul
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of marrowyung
marrowyung

ASKER

I can't find that plan anymore, I will start another question.
as you proactive help me, then that;s why you get my award! I appreciate your help and I usually just want the helper and reader direct me to the right point of solving problem why is it.

and I will keep learning from you all.
ok, tks.