The type of lock that a standard table obtains depends on the isolation level that is in effect and on the data access plan that is being used.
The following tables show the types of locks that are obtained for standard tables under each isolation level for different access plans. Each entry has two parts: the table lock and the row lock. A hyphen indicates that a particular lock granularity is not available.
Isolation level | Read-only and ambiguous scans | Cursored operation | Searched update or delete | ||
---|---|---|---|---|---|
Scan | Where current of | Scan | Update or delete | ||
RR | S/- | U/- | SIX/X | X/- | X/- |
RS | IS/NS | IX/U | IX/X | IX/X | IX/X |
CS | IS/NS | IX/U | IX/X | IX/X | IX/X |
UR | IN/- | IX/U | IX/X | IX/X | IX/X |
Isolation level | Read-only and ambiguous scans | Cursored operation | Searched update or delete | ||
---|---|---|---|---|---|
Scan | Where current of | Scan | Update or delete | ||
RR | S/- | U/- | SIX/X | U/- | SIX/X |
RS | IS/NS | IX/U | IX/X | IX/U | IX/X |
CS | IS/NS | IX/U | IX/X | IX/U | IX/X |
UR | IN/- | IX/U | IX/X | IX/U | IX/X |
Note: Under the UR isolation
level, if there are predicates on include columns in the index, the
isolation level is upgraded to CS and the locks are upgraded to an
IS table lock or NS row locks.
|
Isolation level | Read-only and ambiguous scans | Cursored operations | Searched update or delete | ||
---|---|---|---|---|---|
Scan | Where current of | Scan | Update or delete | ||
RR | S/- | IX/S | IX/X | X/- | X/- |
RS | IS/NS | IX/U | IX/X | IX/X | IX/X |
CS | IS/NS | IX/U | IX/X | IX/X | IX/X |
UR | IN/- | IX/U | IX/X | IX/X | IX/X |
Isolation level | Read-only and ambiguous scans | Cursored operations | Searched update or delete | ||
---|---|---|---|---|---|
Scan | Where current of | Scan | Update or delete | ||
RR | IS/S | IX/U | IX/X | IX/X | IX/X |
RS | IS/NS | IX/U | IX/X | IX/X | IX/X |
CS | IS/NS | IX/U | IX/X | IX/X | IX/X |
UR | IN/- | IX/U | IX/X | IX/X | IX/X |
Isolation level | Read-only and ambiguous scans | Cursored operations | Searched update or delete | ||
---|---|---|---|---|---|
Scan | Where current of | Scan | Update or delete | ||
RR | IS/S | IX/S | IX/X | IX/X | IX/X |
RS | IS/NS | IX/U | IX/X | IX/X | IX/X |
CS | IS/NS | IX/U | IX/X | IX/X | IX/X |
UR | IN/- | IX/U | IX/X | IX/X | IX/X |
Isolation level | Read-only and ambiguous scans | Cursored operations | Searched update or delete | ||
---|---|---|---|---|---|
Scan | Where current of | Scan | Update or delete | ||
RR | IS/S | IX/S | IX/X | IX/S | IX/X |
RS | IS/NS | IX/U | IX/X | IX/U | IX/X |
CS | IS/NS | IX/U | IX/X | IX/U | IX/X |
UR | IN/- | IX/U | IX/X | IX/U | IX/X |
Isolation level | Read-only and ambiguous scans | Cursored operations | Searched update or delete | ||
---|---|---|---|---|---|
Scan | Where current of | Scan | Update or delete | ||
RR | IS/S | IX/S | X/- | ||
RS | IN/- | IN/- | IN/- | ||
CS | IN/- | IN/- | IN/- | ||
UR | IN/- | IN/- | IN/- |
Isolation level | Read-only and ambiguous scans | Cursored operations | Searched update or delete | ||
---|---|---|---|---|---|
Scan | Where current of | Scan | Update or delete | ||
RR | IN/- | IX/S | IX/X | X/- | X/- |
RS | IS/NS | IX/U | IX/X | IX/X | IX/X |
CS | IS/NS | IX/U | IX/X | IX/X | IX/X |
UR | IN/- | IX/U | IX/X | IX/X | IX/X |
Isolation level | Read-only and ambiguous scans | Cursored operations | Searched update or delete | ||
---|---|---|---|---|---|
Scan | Where current of | Scan | Update or delete | ||
RR | IS/S | IX/S | IX/S | ||
RS | IN/- | IN/- | IN/- | ||
CS | IN/- | IN/- | IN/- | ||
UR | IN/- | IN/- | IN/- |
Isolation level | Read-only and ambiguous scans | Cursored operations | Searched update or delete | ||
---|---|---|---|---|---|
Scan | Where current of | Scan | Update or delete | ||
RR | IN/- | IX/S | IX/X | IX/S | IX/X |
RS | IS/NS | IX/U | IX/X | IX/U | IX/X |
CS | IS/NS | IX/U | IX/X | IX/U | IX/X |
UR | IN/- | IX/U | IX/X | IX/U | IX/X |
Isolation level | Read-only and ambiguous scans | Cursored operations | Searched update or delete | ||
---|---|---|---|---|---|
Scan | Where current of | Scan | Update or delete | ||
RR | IS/S | IX/S | IX/X | ||
RS | IN/- | IN/- | IN/- | ||
CS | IN/- | IN/- | IN/- | ||
UR | IN/- | IN/- | IN/- |
Isolation level | Read-only and ambiguous scans | Cursored operations | Searched update or delete | ||
---|---|---|---|---|---|
Scan | Where current of | Scan | Update or delete | ||
RR | IN/- | IX/S | IX/X | IX/X | IX/X |
RS | IS/NS | IX/U | IX/X | IX/U | IX/X |
CS | IS/NS | IX/U | IX/X | IX/U | IX/X |
UR | IS/- | IX/U | IX/X | IX/U | IX/X |