I am running SQL Server 2012 and am trying to put some queries together for monitoring using the DMVs. However, when looking at the
total_elapsed_time field in the
sys.dm_exec_requests DMV, the numbers look way off. Here's an example:
SELECT session_id, RunTime = CURRENT_TIMESTAMP, start_time, total_elapsed_time FROM sys.dm_exec_requests WHERE session_id = 284; session_id RunTime start_time total_elapsed_time 284 2016-04-07 16:14:03.690 2016-04-07 16:08:14.587 1419976
By my calculations*, the elapsed time should be around around 349,103 -- not 1,419,976. That's off by over a factor of 4.
* From the difference, in milliseconds, between the current time and the start_time i.e.
SELECT DATEDIFF(MILLISECOND, '2016-04-07T16:08:14.587', '2016-04-07T16:14:03.690');
Here's the server info:
SELECT @@VERSION; Microsoft SQL Server 2012 - 11.0.5592.0 (X64) Apr 17 2015 15:18:46 Copyright (c) Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
Any ideas what could be causing this discrepancy?