Write better queries. Have better indexes so that queries run faster.
How to fix blockings in sql server?
How to fix blockings in sql server?
SQL Server Other
3 answers
Sort by: Most helpful
-
Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
2023-08-24T21:48:02.2166667+00:00 -
RahulRandive 10,486 Reputation points Volunteer Moderator
2023-08-24T22:04:29.7233333+00:00 Hi @NN
Regardless of which blocking situation we are in, the methodology for troubleshooting locking is the same. Need to find the head blocker and identify what that query is doing and why it's blocking. Once the problematic query is identified (that is, what is holding locks for the prolonged period), the next step is to analyze and determine why the blocking happening. After we understand why, we can then make changes by redesigning the query and the transaction.
Steps in troubleshooting:
- Identify the main blocking session (head blocker)
- Find the query and transaction that is causing the blocking (what is holding locks for a prolonged period)
- Analyze/understand why the prolonged blocking occurs
- Resolve blocking issue by redesigning query and transaction
Here is detailed Microsoft document on Understand and resolve SQL Server blocking problems
Resolve and Troubleshoot SQL Blocking chains with root sessions
Troubleshooting blocking- https://www.mssqltips.com/sqlservertutorial/253/troubleshooting-blocking/
Please find similar thread and blocking queries- https://learn.microsoft.com/en-us/answers/questions/1180235/blocking-gives-me-wrong-impression-in-this-scenari
Thank you!
-
Anonymous
2023-08-25T05:43:17.13+00:00