Knowledge Center

Navigate topics

Performance – Deadlocks View

A deadlock occurs when two or more tasks permanently block each other because each task has a lock on a resource that the other tasks are trying to lock. For example:

  • Transaction A acquires a shared lock on row 1.
  • Transaction B acquires a shared lock on row 2.
  • Transaction A now requests an exclusive lock on row 2. It is blocked until transaction B finishes and releases the shared lock it has on row 2.
  • Transaction B now requests an exclusive lock on row 1. It is blocked until transaction A finishes and releases the shared lock it has on row 1. Transaction A cannot complete until transaction B completes, but transaction B is blocked by transaction A. This condition is also called a cyclic dependency: Transaction A has a dependency on transaction B, and transaction B closes the circle by having a dependency on transaction A.

Both transactions in a deadlock will wait forever unless an external process breaks the deadlock. The SQL Server Database Engine deadlock monitor periodically checks for tasks that are in a deadlock. If the monitor detects a cyclic dependency, it chooses one of the tasks as a victim and terminates its transaction with an error. This allows the other task to complete its transaction. The application with the transaction that terminated with an error can retry the transaction, which usually completes after the other deadlocked transaction has finished.

In each deadlock, there is a single winner and one or more victims that are killed by the system.

Legend
1 Main Deadlock List – according to the selected timeframe. Notice that if you don’t see deadlocks, it might be because the time range is too short.

Column Description
Time The deadlock time
Victim SPID The session ID of the victim
Host The host of the winner session
Application The application of the winner session
Database The calling database of the winner session
Text Data
The winning query. To see the full query, press #6
Show Details Once pressed, it will show the Deadlock Chart (#5), allowing for further analysis
2 DeadlockExpand Button – the button expands the selected deadlock and shows the 4 grid
3 Show Details button – shows the Deadlock Chart
4 Inner Victim Grid. Once 2 Is pressed, the victim grid is displayed. For most occurrences, there will be a single victim.

Column Description
Process SPID The victim’s session ID
Host The host of the victim session
Application The victim’s calling application
Database The victim’s originating database (from query)
Login The victim’s login
Log Used The log used during the transaction
Lock Type The victim’s lock type of the locked object
5 The deadlock chart
6 The victim expand button – press to see process details on the right panel (#8, #9)
7 The winner expand button – press to see winner process details on the right panel (#8, #9)
8 Expanded process details

Column Description
Host The process originating host
Application The process calling application
Database The process database (from query)
Login The login that started the process
Log Used The total log used during the transaction
Deadlock Priority Priority of the deadlock from the SQL engine
Wait Time Total wait time before deadlock detection and elimination
Mode\Type Process lock type of locked object
Isolation Level Session isolation level at the time of deadlock
Transaction

 

The deadlock chart

 

Legend
1,3 Victim lock mode
2 Victim expand button (expands panels on the right with victim’s details)
4 Victim object lock
5 Winner object lock
6,8 Winner lock mode
7 Winner expand button (expands panels on the right with winner’s details)

Request a demo

Fill out your details. 

We’ll get back to you soon.

With Experda, database teams trade manual work with automations and replace clunky operations with streamlined workflows.

Contact Sales

Fill out your details. 

We’ll get back to you soon.

Request a Proposal.

Fill out your details. 

We’ll get back to you soon.

Contact us

Fill out your details. 

We’ll get back to you soon.

Need professional DBA services?

Fill out your details. 

We’ll get back to you soon.

With Experda, database teams trade manual work with automations and replace clunky operations with streamlined workflows.

Need professional BI services?

Fill out your details. 

We’ll get back to you soon.

Get help from Experda

Fill out your details. 

We’ll get back to you soon.

Request a demo

Fill out your details. 

We’ll get back to you soon.

This website uses cookies to remember you and improve your experience. To find out more see our Privacy Policy.