SQL Server 2019 - suspicious values in sys.sm_exec_sessions.last_request_end_time

118 Views Asked by At

We continuously gather data from sys.sm_exec_sessions and sys.dm_exec_requests to be able further investigate our locking and performance issues.

In some cases, I can see that multiple queries to sys.sm_exec_sessions returns the same value of last_request_start_time but different (not-null) values of last_request_end_time.

Is it standard behavior? What does it mean when one request has multiple end times?

Regarding to documentation, I would expect that each change to last_request_start_time should be followed with just one change of last_request_end_time. Am I missing something?

last_request_start_time Time at which the last request on the session began. This includes the currently executing request. Is not nullable.

last_request_end_time Time of the last completion of a request on the session. Is nullable.

Example bellow shows result of five subsequent queries to sys.dm_exec_requests. Each call returns one record. All results shows same sart_time but unique end_time.

select 
    es.session_id,  
    es.program_name,
    es.last_request_start_time,
    es.last_request_end_time
from 
    sys.dm_exec_sessions es 
where 
    es.session_id = 124

1. 124    Worker@72045511    2022-04-04 14:43:19.993    2022-04-04 15:00:58.050
2. 124    Worker@72045511    2022-04-04 14:43:19.993    2022-04-04 15:02:16.333
3. 124    Worker@72045511    2022-04-04 14:43:19.993    2022-04-04 15:02:43.640
4. 124    Worker@72045511    2022-04-04 14:43:19.993    2022-04-04 15:03:02.520
5. 124    Worker@72045511    2022-04-04 14:43:19.993    2022-04-04 15:03:07.887
0

There are 0 best solutions below