Causes and Solutions for Deadlocks

In the preceding chapter, I discussed how blocking works. Blocking is the primary cause of poor performance. It can lead to a special situation referred to as a deadlock, which in turn means that deadlocks are fundamentally a performance problem. When a deadlock occurs between two or more transactions, SQL Server allows one transaction to complete and terminates the other transaction, rolling back the transaction. SQL Server then returns an error to the corresponding application, notifying the user that he has been chosen as a deadlock victim. This leaves the application with only two options: resubmit ...

Get SQL Server Query Performance Tuning,Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.