Sql-server – Total_worker_time over SQL 2008 linked server

linked-serversql serversql-server-2008

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?

Best Answer

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.