![]() We will check again for the sql_handle in sys.dm_exec_query_stats. This has a similar effect to generating an “attention” event as a command timeout. Now I will stop the executing query in SSMS (session 52). Note, the query is still executing at this point. We can use this sql_handle to query sys.dm_exec_query_stats.Īs you can see there are no entries for this query/sql_handle in sys.dm_exec_query_stats. This is executed on session 52.įrom querying sys.dm_exec_requests for the hung session_id (52), we’re able to retrieve the sql_handle. Next I’ll execute a statement that should hang (as a result of the update we performed above). This makes sure we aren’t picking up any previously existing stats. Next I’ll clear the plan cache with DBCC FREEPROCCACHE. Update CustomerTest set ModifiedDate = getdate() where customerid = 1 ![]() This update is wrapped in a begin transaction, but does not have a commit (we refer to these as developers with commitment problems). Exampleįor this example I will update a record which will cause another session to block. ![]() The timeout period elapsed prior to completion of the operation or the server is not responding”) do not factor into the statistics shown in sys.dm_exec_query_stats. If you’re looking for your worst performers by querying sys.dm_exec_query_stats, be aware queries that are timing out (i.e. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |