Design Locking and Granularity levels Flashcards
What does lock escalation always escalate to?
Table Lock
What does lock escalation never escalate to?
page lock
What happens if a transaction attempts to escalate a lock but is unable to because there is an incompatible lock on the table?
It attempts to acquire locks at its original more granular level (row, key, page) periodically while checking for escalated locks
How can you disable lock escalation?
Enable trace flag 1211
How does SQL Server determine which transaction to kill in a deadlock scenario?
Deadlock Priority
Rollback Cost
What is Deadlock Priority?
The number given to a transaction to show it’s importance to complete the transaction
What is Rollback Cost?
If two transactions have the same priority, then SQL determines the lowest cost to roll back and kills that session.