lock-escalation

Which Locks Count Toward Lock Escalation?

Which Locks Count Toward Lock Escalation?

A little while back I wrote about Why Indexes Reduce Locks for Update and Delete Queries.

I got a great question on the post from Zac:

What’s not super clear is why it takes out a lock on the whole table, is this because it does a lock escalation as a result of the Full Scan? Will this always happen, or is there a threshold of record update counts where this will occur?

This was tough to answer in just a comment, so I promised a full post on the topic.

Why ROWLOCK Hints Can Make Queries Slower and Blocking Worse in SQL Server

Why ROWLOCK Hints Can Make Queries Slower and Blocking Worse in SQL Server

Sometimes when SQL Server gets slow, developers and DBAs find that the problem is blocking. After lots of work to identify the query or queries which are the blockers, frequently one idea is to add ROWLOCK hints to the queries to solve the problem or to disable PAGE locks on the table. This often backfires - here’s why.