You are on page 1of 3

University of Pittsburgh

School of Computing and Information

INFSCI 2711: Advanced Topics in Database


Management
Spring 2020
Homework 2

Graded out of 90 points;

Due: Wednesday March 25th at noon

1. [30pt] Consider a database system replicated over sites in Pitt, NYC, Chicago, Washington,
Philadelphia. Assume that the database system stores the following relation:
Employee (eid, ename, dep_id, sal)
Consider the following query:

select * from Employee where dep_id = 1;


Consider also the following lock settings:
1. Lock Pitt, Philadelphia and NYC
2. Lock Pitt, Washington, NYC and Philadelphia
3. Lock Pitt

Finally, consider the following four options for lock management:


(1) majority protocol;
(2) biased protocol;
(3) quorum consensus protocol;
For quorum consensus protocol assume the following parameters: weights: Pitt=1, NYC=2,
Washington=2, Chicago=1, Philadelphia=3, Qr = 6, Qw=7.
For each of the lock management options indicate if it is possible for given lock setting. Your
answers should be represented in the following table (each answer should be either “yes”, or
“no”) and justify your answers by calculation.

Lock setting Majority Biased Quorum Consensus


1
2
3
      

2. [30 pt] Consider the following partial schedule for transactions with timestamps
1,2,3,4,5:

T1 T2 T3 T4 T5
Read(X)
Read(Y)
Read(X)
Write(X)
Read(Y)
Read(Y)
Write(Y)
Read(Y)
Write(Z)
Read(Z)

Which of the above transactions will be aborted according to the timestamp-based


protocol? Please explain your answers.

3. [20 pts] Suppose that 2PC is used as a commit protocol. Consider the following parts of
recovery sub-scenarios for a distributed transaction T with coordinator C and two
participating sites P1 and P2:
1.1 P2 checks its log and then aborts.
1.2 P1 sends query status request to P2 and then commits.
1.3 P1 sends query status request to P2 and then waits for messages from C.
Consider the following cases:
(a) A participating site for T fails after receiving a commit message.
(b) A participating site for T fails after sending a ready message.
(c) The coordinator site for T fails after sending a commit message.
For each of the recovery sub-scenarios specify a group of above cases that are
possible for that sub-scenario. Your answer should be represented as the following table
(please, provide your explanation):
Sub-scenario Possible cases (e.g., (a),(b), …)
1.1
1.2
1.3
4. [10 pts] Find the Query Optimization of the following expression with the
multiple transformation (include all steps).
Π student name

σ student country =' USA '∧ department =' computer ' ∧ class=' INFSCI 2711 '

Department

Student Class

You might also like