1

I’ve come across a lengthy SP that is being recorded as generating a high amount of total_worker_time in sys.dm_exec_procedure_stats. (But I think it might be a red-herring)

The SP contains cursors and distributed updates over linked MS SQL Servers.

When a query takes place over a linked server, does the local server record Elapsed time in place of CPU time, or does the remote server return the actual CPU time to the local server?

2

When a query takes place over a linked server, does the local server record Elapsed time in place of CPU time, or does the remote server return the actual CPU time to the local server?

When executing a query over Linked Server the SQL Server session will enter an OLEDB wait while waiting for results, and that time will not be accounted for as CPU_time. The linked server does not return wait stats.

| improve this answer | |
  • Does the OLEDB wait time become part of the Total_Worker_Time? – pacreely Sep 5 '18 at 15:15
  • No Total_Worker_Time is only CPU time. Elapsed Time = Worker Time + Wait Time. – David Browne - Microsoft Sep 5 '18 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.