While creating a stored proc to detect long running processes I noticed total_elapsed_time from dm_exec_requests was reporting incorrect times when update statistics is running. It may be doing this for other processes as well, but this is one I am able to replicate consistently. It starts out reporting the correct elapsed time, but quickly the reported time becomes more than double the actual elapsed time. Has anyone noticed this behavior? I can't find any documented bugs.
If I run the following command and hit enter constantly I eventually see the time jump beyond the actual execution time. Execution time is taken from my PC.
Select total_elapsed_time ,
total_elapsed_time as total_elapsed_time,
total_elapsed_time/1000 as total_elapsed_time_Sec,
total_elapsed_time/1000/60 as total_elapsed_time_Min
From sys.dm_exec_requests
Sorry. I had one too many columns in the query. Below is a sample of what I am running.
Select total_elapsed_time ,
total_elapsed_time/1000 as total_elapsed_time_Sec,
total_elapsed_time/1000/60 as total_elapsed_time_Min
From sys.dm_exec_requests