Information Technology Reference
In-Depth Information
for the lock, then, after the lock is granted, the transaction would use the page-id
saved from the access, latch the page, and inspect its contents to find out if the page
is still the correct target for the action, as explained in Sect. 6.7 and Chap. 7 .Ifthe
P AGE -LSN of the page has not changed, the transaction would operate on that page
and not traverse the new structure of the relation.
Problems
11.1 Identify the different kinds of dirty writes, dirty reads, and unrepeatable read
that can appear in histories of the transactions that can contain both primary-key-
based and secondary-key-based actions, as defined in Sect. 11.1 .
11.2 What locks must be acquired for a secondary-key-based bulk-delete action
D Y Œs Y ;s XYV when using (a) key-specific key-range locking, and (b) partition-based
key-range locking?
11.3 Assume that the secondary index shown in Fig. 11.1 does not yet exist and that
the following sequence of actions is executed:
1. The index constructor begins the extraction of the index records for the secondary
index; it write-latches page p 1 , scans the tuples, and unlatches page p 1 .
2. Transaction T
starts
and
performs
the
insert
actions I Œ27; 101; v 11
and
I Œ12; 150; v 12 .
3. The index constructor write-latches page p 2 , scans the tuples, and unlatches p 2 .
4. T performs the actions I Œ15; 103; v 13 and I Œ41; 104; v 14 , the abort action A,and
the undo action I 1 Œ41; 104; v 14 .
5. The index constructor write-latches page p 3 , scans the tuples, and unlatches p 3 .
6. T performs the undo actions I 1 Œ15; 103; v 13 and I 1 Œ12; 150; v 12 .
7. The index constructor populates the index, processes the side file, and completes
the index construction.
8. T performs the undo action I 1 Œ27; 101; v 11 and the complete-rollback action C .
Give the contents of the side file at each step. Give the set of index records in the
leaf pages of the secondary index at the end of steps 7 and 8. What log records are
generated for transaction T ?
11.4 What actions are needed to restart the index-construction process when a
failure occurs during the population of the index in Algorithm 11.4 or during the
side-file processing in Algorithm 11.5 ?
11.5 Give the secondary-index-specific actions needed in performing a delete
action DŒx; y; v and an undo-delete action D 1 Œx; y; v by transaction T on relation
r. X ;Y;V/when the secondary index may be in construction at the same time.
11.6 In the case of our model of transactions with primary-key-based and
secondary-key-based actions on the relation r. X ;Y;V/, the log contains all the
Search WWH ::




Custom Search