






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!







-^
big queries should lock coarse-grained data (e.g. tables)
short transactions lock fine-grained data (e.g. rows)
-^
each data item (e.g., table or row) has a different id
-^
exploit the natural hierarchy of data containment
before locking fine-grained data, set
intention locks
on
coarse grained data that contains it
e.g., before setting a read-lock on a row, get anintention-read-lock on the table that contains the row
Database
Area^ File Record
Lock Type
Graph
Lock Instance Graph
Before setting a read lock on R2.3, first set an intention-readlock on DB1, then A2, and then F2.
-^
Set locks root-to-leaf. Release locks leaf-to-root.
-^
-^
th
Area
File
Record
Index Index Entry
MS SQL Server can lock at table, page, and row level.
-^
Uses intention read (“share”) and intention write(“exclusive”) locks at the table and page level.
-^
Tries to avoid escalation by choosing the “appropriate”granularity when the scan is instantiated.
Table Page
Index Range
Extent
-^
Keep the hot data in main memory
Delay operations on hot data till commit time
Use optimistic methods
Batch up operations to hot spot data
Partition hot spot data
-^
-^
-^
Data Entry DB
Main Storage DB
-^
-^
-^
If it returns a different value than it did duringnormal execution, then abort
It’s like checking that the threshold lock you didn’tset during Decrement is still valid.
bEnough = Verify(iQuantity, n);If (bEnough) Decrement(iQuantity, n)else print (“not enough”);
-^
-^
-^
Client does all updates in cache without shared locks
At commit time, try to get locks and perform updates