question

kpskumar27 avatar image
kpskumar27 asked

confusion in calculating Avg CPU utilization of a Stored procedure

Hi All, I am a SQL database administrator. We are using SQL Server 2012 in our organization. Curretly, I am assigned with a task on performance tuning the stored procedures. I am tuning the SPs with the help of DMV sys.dm_exec_procedure_stats. There I found two execution plans for one stored procedure. Now, if I want to find the average CPU, how should I calculate, > Do I need to do a find sum(total_physical_reads) of both the plans and divide it by the sum(execution_count) of both execution plans > or, Do I need to find the total_physical_reads/execution_count for for both the plans individually and sum both the averages atlast. Kindly clarify. Thanks in advance, K.P.Senthil Kumar
sql server 2012dmv
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Kev Riley avatar image
Kev Riley answered
For average CPU you want sum(total_worker_time) / sum(executions). total_physical_reads is measuring disk IO.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thankyou so much kev
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.