Chapter 13. Block and deadlock analysis
If only one or two users needed to get to your data, then locking and blocking wouldn’t be necessary, but there wouldn’t be very much point to having SQL Server, either! As it is, concurrent-access database systems like SQL Server implement locking to help ensure individual users don’t overly impact one another when they’re all accessing the same data. In this chapter, we’ll look at what locks do, how they work, and how they can negatively impact system performance. I’ll be focusing on helping you gather evidence of poorly written or slow-running queries, so that you can work with a developer or vendor to help improve performance.
Imagine a bunch of people gathered around a bulletin board, all trying to read the posted information. As some are trying to read the list, others are erasing items and scribbling in new ones. Sometimes, people don’t get to read an entire item before someone else is erasing it. Sometimes, two people are trying to rewrite the same item at the same time, getting into arguments, writing over each other’s post, and generally creating chaos.