Professional Documents
Culture Documents
Transproc PDF
Transproc PDF
+ c Dennis Shasha
° 1
+ +
Main Topics
+ c Dennis Shasha
° 2
+ +
Concurrency Control
+ c Dennis Shasha
° 3
+ +
+ c Dennis Shasha
° 4
+ +
Recovery
+ c Dennis Shasha
° 5
+ +
Database Tuning
What is it?
+ c Dennis Shasha
° 6
+ +
Tuning in Context
• High performance.
The concern of tuning.
+ c Dennis Shasha
° 7
+ +
+ c Dennis Shasha
° 8
+ +
+ c Dennis Shasha
° 9
+ +
+ c Dennis Shasha
° 10
+ +
+ c Dennis Shasha
° 11
+ +
+ c Dennis Shasha
° 12
+ +
Advanced Topics
+ c Dennis Shasha
° 13
+ +
Also “correctly.”
+ c Dennis Shasha
° 1
+ +
+ c Dennis Shasha
° 2
+ +
begin transaction
sequence of operations
end transaction
+ c Dennis Shasha
° 3
+ +
+ c Dennis Shasha
° 4
+ +
Serializability
+ c Dennis Shasha
° 5
+ +
Schedule Equivalence
+ c Dennis Shasha
° 8
+ +
+ c Dennis Shasha
° 9
+ +
Guaranteeing Serializability
+ c Dennis Shasha
° 10
+ +
+ c Dennis Shasha
° 11
+ +
+ c Dennis Shasha
° 12
+ +
Read locks
+ c Dennis Shasha
° 13
+ +
+ c Dennis Shasha
° 14
+ +
Deadlock Detection
+ c Dennis Shasha
° 15
+ +
+ c Dennis Shasha
° 16
+ +
+ c Dennis Shasha
° 17
+ +
+ c Dennis Shasha
° 18
+ +
+ c Dennis Shasha
° 19
+ +
Definitions
N — multiprogramming level.
+ c Dennis Shasha
° 20
+ +
Derivation
+ c Dennis Shasha
° 21
+ +
Response Time
Then R = T + (R/2)kp.
+ c Dennis Shasha
° 22
+ +
Qualitative conclusions
+ c Dennis Shasha
° 23
+ +
Multi-granularity Locks
+ c Dennis Shasha
° 24
+ +
+ c Dennis Shasha
° 25
+ +
+ c Dennis Shasha
° 26
+ +
if TS(T) ≥ WTS(x)
then T reads x, RTS(x) := max(RTS(x),TS(T))
else T aborts
+ c Dennis Shasha
° 27
+ +
+ c Dennis Shasha
° 28
+ +
+ c Dennis Shasha
° 29
+ +
+ c Dennis Shasha
° 30
+ +
+ c Dennis Shasha
° 31
+ +
+ c Dennis Shasha
° 32
+ +
+ c Dennis Shasha
° 33
+ +
+ c Dennis Shasha
° 34
+ +
+ c Dennis Shasha
° 35
+ +
+ c Dennis Shasha
° 36
+ +
Deadlock
+ c Dennis Shasha
° 37
+ +
+ c Dennis Shasha
° 38
+ +
Performance Conclusion
+ c Dennis Shasha
° 39
+ +
+ c Dennis Shasha
° 40
+ +
if RS(i) ∩ WS(active) = φ
and WS(i) ∩ (RS(active) ∪ WS(active)) = φ
then certify (commit)
else abort
+ c Dennis Shasha
° 41
+ +
+ c Dennis Shasha
° 42
+ +
+ c Dennis Shasha
° 43
+ +
Datacycle Architecture
+ c Dennis Shasha
° 44
+ +
+ c Dennis Shasha
° 45
+ +
Basic scheme:
+ c Dennis Shasha
° 46
+ +
+ c Dennis Shasha
° 47
+ +
Site recovery
2. Replicated parts:
+ c Dennis Shasha
° 48
+ +
+ c Dennis Shasha
° 50
+ +
Weikum’s technique
+ c Dennis Shasha
° 51
+ +
Escrow Method
+ c Dennis Shasha
° 52
+ +
SAGAS
+ c Dennis Shasha
° 53
+ +
Workflow Systems
+ c Dennis Shasha
° 54
+ +
• http://www.aiai.ed.ac.uk/WfMc/ Workflow
Management Coalition gives an overview
of systems.
+ c Dennis Shasha
° 55
+ +
+ c Dennis Shasha
° 56
+ +
Concurrency Control
+ c Dennis Shasha
° 57
+ +
Multi-level Recovery
+ c Dennis Shasha
° 58
+ +
Fuzzy Checkpointing
+ c Dennis Shasha
° 59
+ +
+ c Dennis Shasha
° 1
+ +
Assumptions
What is a failure?
+ c Dennis Shasha
° 2
+ +
Our Assumptions
+ c Dennis Shasha
° 3
+ +
Database Model
Operations:
+ c Dennis Shasha
° 4
+ +
States of a Transaction
+ c Dennis Shasha
° 5
+ +
+ c Dennis Shasha
° 6
+ +
Logging Rules
+ c Dennis Shasha
° 7
+ +
Algorithmic Taxonomy
Possibilities:
1. No Undo, No Redo
2. No Undo, Redo
3. Undo, No Redo
4. Undo, Redo
+ c Dennis Shasha
° 8
+ +
No Undo, Redo
+ c Dennis Shasha
° 9
+ +
+ c Dennis Shasha
° 10
+ +
Undo, No Redo
+ c Dennis Shasha
° 11
+ +
+ c Dennis Shasha
° 12
+ +
No Redo, No Undo
+ c Dennis Shasha
° 13
+ +
+ c Dennis Shasha
° 14
+ +
+ c Dennis Shasha
° 15
+ +
+ c Dennis Shasha
° 16
+ +
Solution
Failure Scenarios
+ c Dennis Shasha
° 18
+ +
Performance Enhancements
+ c Dennis Shasha
° 19
+ +
On Recovery
+ c Dennis Shasha
° 20
+ +
Arthur Whitney
KX Systems, a@kx.com
Dennis Shasha
New York University, shasha@cs.nyu.edu
+ c Dennis Shasha
° 1
+ +
Our Biases
+ c Dennis Shasha
° 2
+ +
• Concurrency Control:
Nasty bugs: if aborts aren’t handled properly
by the application, effects of aborted transactions
leave effects on program variables. These
bugs are not discovered until production.
+ c Dennis Shasha
° 3
+ +
An Example Alternative
+ c Dennis Shasha
° 4
+ +
+ c Dennis Shasha
° 5
+ +
Algorithm OBEYORDER
+ c Dennis Shasha
° 6
+ +
+ c Dennis Shasha
° 7
+ +
Summary
+ c Dennis Shasha
° 8
+ +
Dennis Shasha
Eric Simon
Patrick Valduriez
+ c Dennis Shasha
° 1
+ +
Outline
• Motivation
• Critical Assumption
• Example
• Sufficient Conditions
• Chopping Optimization
• Applications
+ c Dennis Shasha
° 2
+ +
Motivation
Aimed at designers.
+ c Dennis Shasha
° 3
+ +
Critical Assumption
+ c Dennis Shasha
° 4
+ +
Purchase Transaction — 1
Purchase:
add value of item to inventory;
subtract money from cash.
+ c Dennis Shasha
° 5
+ +
Purchase Transaction — 2
+ c Dennis Shasha
° 6
+ +
Purchase Application — 3
+ c Dennis Shasha
° 7
+ +
Purchase Transaction — 3
+ c Dennis Shasha
° 8
+ +
Purchase Transaction — 4
+ c Dennis Shasha
° 9
+ +
+ c Dennis Shasha
° 10
+ +
Assumptions
+ c Dennis Shasha
° 11
+ +
Chopping
+ c Dennis Shasha
° 12
+ +
Graphical Characterization
+ c Dennis Shasha
° 13
+ +
Correctness
+ c Dennis Shasha
° 14
+ +
+ c Dennis Shasha
° 15
+ +
Proof of theorem 1
Purchase Example
Original transactions:
P(i,p):
1. if cash > p then invent(i) += p;
2. cash -= p;
+ c Dennis Shasha
° 17
+ +
Purchase Variant
Original transactions:
P(i,p):
1. if cash > p then cash -= p;
2. invent(i) += p;
+ c Dennis Shasha
° 19
+ +
CHOPPING EXAMPLE
2. read(cash); cash-=price;
write(cash);
T11 T21
c
s s
c
T12 T22
c
Fig.C.1
+ c Dennis Shasha
° 20
+ +
CHOPPING EXAMPLE
2. read(inventory[item]; inventory[item]+=price;
write(inventory[item]);
c
T11 T21
s
s
T12 T22
Fig. C.2
+ c Dennis Shasha
° 21
+ +
Example 1
+ c Dennis Shasha
° 22
+ +
Example 1 — Chop T1
No cycle.
+ c Dennis Shasha
° 23
+ +
T111: R(x)
T112: W(x)
+ c Dennis Shasha
° 24
+ +
Optimization
Answer: yes.
+ c Dennis Shasha
° 25
+ +
Reasons
+ c Dennis Shasha
° 26
+ +
+ c Dennis Shasha
° 28
+ +
s
T11 T12
c c
Putting the three pieces of T3 into one will not make the chopping
of T1 OK. Nor will chopping T3 further.
Fig. C.3
+ c Dennis Shasha
° 29
+ +
+ c Dennis Shasha
° 30
+ +
Example Application
SELECT ...
FROM account
Update ...
FROM account
WHERE acctnum = :x
+ c Dennis Shasha
° 31
+ +
SELECT
REPLACE...
s c accntnum = :x
s
s
s c REPLACE...
s accntnum = :x
s
s
s
s
s
s
s
s
s
Fig. C.4
+ c Dennis Shasha
° 32
+ +
Related Work
+ c Dennis Shasha
° 33
+ +
Related Work — 2
+ c Dennis Shasha
° 34
+ +
Related Work — 3
+ c Dennis Shasha
° 35
+ +
Future Work
Have:
simple, efficient algorithm to partition transactions
into the smallest pieces possible when transaction
mix is known.
Open:
+ c Dennis Shasha
° 36
blackandwhitewallstreet.tex
+ +
high performance,
buffer management
replacement algorithm
——————-
+ c Dennis Shasha
° 1
+ +
Buffer Management
+ c Dennis Shasha
° 2
+ +
+ c Dennis Shasha
° 3
+ +
Problem Closed?
+ c Dennis Shasha
° 4
+ +
+ c Dennis Shasha
° 5
+ +
LRU/2
+ c Dennis Shasha
° 6
+ +
LRU/2 Characteristics
+ c Dennis Shasha
° 7
+ +
2Q Motivation
• Answer: yes.
+ c Dennis Shasha
° 8
+ +
+ c Dennis Shasha
° 9
+ +
+ c Dennis Shasha
° 10
+ +
+ c Dennis Shasha
° 11
+ +
+ c Dennis Shasha
° 12
+ +
Experiments
+ c Dennis Shasha
° 13
+ +
+ c Dennis Shasha
° 14
+ +
DB2
Page slots LRU/2 LRU 2Q 2Q
Kin=30% Kin=20%
50 .345 .317 .349 .349
100 .432 .413 .444 .430
200 .516 .512 .521 .510
500 .610 .606 .624 .611
1000 .665 .654 .686 .681
2000 .712 .704 .729 .730
3000 .738 .730 .750 .753
4000 .755 .748 .767 .766
5000 .768 .762 .778 .777
6000 .778 .773 .785 .786
7000 .786 .781 .791 .791
8000 .792 .789 .795 .795
9000 .798 .795 .798 .799
10000 .802 .801 .801 .801
+ c Dennis Shasha
° 15
+ +
Conclusion
+ c Dennis Shasha
° 16
+ +
+ c Dennis Shasha
° 1
+ +
+ c Dennis Shasha
° 2
+ +
Possible Queries
+ c Dennis Shasha
° 3
+ +
+ c Dennis Shasha
° 4
+ +
+ c Dennis Shasha
° 5