






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Outline
Conversions in MS SQL Server
-^
Conflicts with other update and write locks, but notwith read locks.
Only on pages and rows (not tables)
-^
Select Foo.AFrom Foo (UPDLOCK)Where Foo.B = 7
Blocking and Lock Thrashing
Throughput
High^ Low
Low
High
increasing load
thrashing
Avoiding Thrashing
-^
-^
They happen due to long lock delays
So the system is probably close to thrashing
So if deadlock detection rate is too high (over 2%)reduce the number of active transactions
Interesting Sidelights
-^
But it assumes you get exactly the locks you needand retries of get-all-locks are cheap
-^
If aborts are cheap and there’s low contention forother resources, then this policy produces higherthroughput before thrashing than a blocking policy
But response time is greater than a blocking policy
Reducing Lock Contention (cont’d)
-^
Use finer grained locks, e.g., by partitioning tablesvertically^ Part#
Price OnHand PartName CatalogPage
Part#
Price OnHand
Part#
PartName CatalogPage
system that supports it)
Mathematical Model of Locking
-^
KN/2 in total
-^
-^
-^
2
Prob(deadlock) / Prop(conflict) = K
if K=10 and D = 10
6 , then K
K locks per transaction
-^
D lockable data items
N transactions
-^
T time between lock requests
Docsity.com