Hi All ,
I have code below running frequently on multiple DB and causing high CPU utilization plus the long running duration
so I thought to share to have your support in fine tune it
-----------SQL Query ----------------------------
UPDATE [R001].[Details]
SET [RecID]=
(SELECT [Id] FROM [R001].[SRecords]
where [ID]=[Details].BID
AND [BID]=[Details].BID
AND [Type] = [Details].[ACID])
-----------------------------------------------IO STATISTCS & TIME STATITCS ------------------------------------------------
Table 'Worktable'. Scan count 53988, logical reads 2196352, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'SRecords'. Scan count 2, logical reads 264, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'Details'. Scan count 1, logical reads 1971, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
SQL Server Execution Times:
CPU time = 80590 ms, elapsed time = 80648 ms.
(82345 row(s) affected)
------------------------------------------------------------------------------------------------------------------------
Thanks
No comments:
Post a Comment