0

I know I can get wait stats about "current" queries via their SPID in sys.dm_exec_session_wait_stats but the SPID is recycled into new sessions.

Is there a way to query these stats for queries a few days old, when their SPID has been reused...?

I am using SQL 2019

2
  • 1
    no , you need to have a monitoring system in place that you can refer to for these cases , sql server is not tracking/logging these stuff as far as I know Commented Oct 23, 2024 at 16:23
  • 1
    If you have query store enabled you can get some aggregated info from sys.query_store_wait_stats - (both aggregated in terms of lumping stats for different executions of the same query plan together and in lumping different wait types together into broader categories) Commented Oct 23, 2024 at 19:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.