[20 points] After a
system’s crash,
the undo-log using non-quiescent checkpointing contains the following
data:
a.
What are the correct values of the three
<START CKPT
????> records
? You
have to provide three correct values for the three
“????”s.
b.
Assuming that the three <START CKPT ???> records are correctly
stored in the log, according to your
answer at a., show which elements are recovered by the undo recovery
manager and compute their values after recovery.
<START T1> |
<T1 X1 55> |
<START T2> |
<T2 X2 99> |
<COMMIT T1> |
. . . . |
Is represented by the table:
N |
T |
E |
V |
0 |
T1 |
-1 |
|
1 |
T1 |
X1 |
55 |
2 |
T2 |
-1 |
|
3 |
T2 |
X2 |
99 |
4 |
T1 |
-2 |
|
. . . |
|
|
|
Recall that each
transaction starts
and ends at
most once, i.e. a sequence <START T> …
<COMMIT T> …
<START T>
… will not occur in the log. Moreover, any update by the
transaction T
will
occur between its <START T> and <COMMIT T>,
or between
<START
T> and <ABORT T> respectively.
Write a SQL query that can be run during database recovery, after a
system
crash. The answer to your query should return a table with two
attributes, E,
and V, indicating which elements have to be updated
with what
values.
You should include each element E at most once in
your answer:
otherwise
it would be ambiguous how to update it.
3.1. For each of the following schedules:
i. What is the precedence graph for the schedule?
ii. Is the schedule confict-serializable? If so, what are all the equivalent serial schedules?
Say that a transaction T precedes a transaction U
in
a schedule S if every action of T precedes every action of U in S. Note
that if
T and U are the only transactions in S, then saying T precedes U is the
same as
saying that S is the serial schedule (T, U). However, if S involves
transactions other than T and U, then S might not be serializable, and
in fact,
because of the effect of other transactions, might not even be
conflict-serializable.
Give an example of a schedule S such that:
Below are several sequences of events, including start
events, where sti means that transaction Ti
starts. These
sequences represent real time, and the timestamp-based scheduler will
allocate
timestamp to transactions in the order of the starts. Tell what happens
as each
executes.
In the following sequences of events, we use Ri(X)
to mean “transaction Ti starts, and
its read set is the list of
database elements X.” Also, Vi means
“Ti attempts to
validate,” and Wi(X) means that
“Ti finishes, and its
write set was X.” Tell what happens when each sequence is
processed by a
validation-based scheduler.
1. R1(A, B); R2(B, C); V1; R3(C, D); V3; W1(A); V2; W2(A); W3(B);
2. R1(A, B); R2(B, C); V1; R3(C, D); V3; W1(A); V2; W2(A); W3(D);
[20 points] You will use only the Movie table in the IMDB database on IPROSRV for this task. You need to come up with as many SQL SELECT queries as it takes you to get query plans that include all of these features:
Your queries may not use the OPTION or related keywords to force the use of a particular index or join type. Turn in a numbered (corresponding to the numbers above) list of your queries; it should look something like this:
1 - select ... from movie ... where ...
...
2,5,6 - select ... from movie ... where ...
Note: In SQL Server 2005, you can see the execution plan for a query by going to Query >> Display Estimated Execution Plan (or CTRL+L).