Skip to content

Locks

The Lock band shows locks acquired and released over the life of the query - how SQL Server protects data being read and modified from conflicting changes by other transactions. Locks are only captured when enabled - see the Events menu.

Locks are bucketed per object, and each object's locks are banded by category, split into non-schema and schema locks - schema locks are banded separately so they don't dominate the view, since they are typically held for longer and across a broader scope than row/page/key locks.

Within a band, locks are drawn as a histogram - a bar chart showing the volume of locks held in that category over time.

Categories and colours

The lock modes are grouped into categories:

CategoryLock modesColour
ReadS, ISGreen
UpdateU, IU, SIUAmber
Write / ExclusiveX, IX, SIX, UIXRed
SchemaSCH_S, SCH_MPurple
RangeRS_, RI_, RX_*Blue
BulkBUTeal

These colours are used consistently wherever lock state is shown - including the border drawn around pages on the Allocations pane. Intent lock modes (the I-prefixed and SI/UI modes) are dimmed relative to their full counterpart.

Lock escalation

When a query holds too many fine-grained locks, SQL Server escalates them to a single coarser lock on the whole object. A lock escalation is marked as a discrete event on the timeline - a solid vertical line at the point of escalation, with a tooltip describing the change, e.g. "Lock escalation: X (Exclusive) on Object, replacing 6249 lock(s)":

Lock escalation marker on the timeline