LearnPerformance

Blocking And Deadlocks: What To Look At First

1 min readUpdated 6 Nov 2026

Blocking is one session making another wait. A deadlock is two sessions waiting on each other until the engine kills one. Both show up as 'the app is stuck', and both need a different fix.

For blocking, find the head

A blocked chain has a top. The session at the head is often not the one the application is complaining about — it is a session that opened a transaction, did something slow, and never closed it.

  1. 1.List currently blocked requests with their blocking session id.
  2. 2.Walk up until you reach the session nobody is blocking.
  3. 3.Read that session's last statement and how long its transaction has been open.
  4. 4.Check whether it is idle with an open transaction — that is the most common cause.

For deadlocks, read the graph

The deadlock graph names both sessions, the resources they held, the resource each wanted, and which one was chosen as the victim. Two things are worth checking every time:

  • Do both queries touch the same tables in a different order?
  • Is one query taking more locks than it should, because an index is missing?

Lock escalation makes small problems sudden

A statement that locks thousands of rows can escalate to a table lock, which blocks everything. It looks like a sudden outage caused by an ordinary query. If a single statement suddenly blocks the whole table, check how many rows it touched.

Long-running transactions and missing indexes cause most blocking and deadlocks. Application retry logic turns both into a bad morning.

What to remember

  • Blocking: find the head session, then its open transaction.
  • Deadlocks: read the graph for lock order and the victim.
  • Watch for lock escalation turning a row query into a table lock.
  • Short transactions and correct indexes fix most of it.

Related guides