Information Technology Reference
In-Depth Information
being constructed, the side file is processed and the updates stored there are applied
to the index.
When the secondary index is ready and declared available for use in query-
execution plans, a transaction T inserting a tuple .x; y; v / into data page p must also
insert the index record .y;x;p/ into the secondary index. This is done by the call
insert-index-record .T;y;x;p/ at the end of the call insert .T;x;y; v /, as explained
above in Sect. 11.2 . Similarly, a transaction T deleting a tuple .x; y; v / from data
page p must use, at the end of the call delete .T;x;y; v /, the call delete-index-
record .T;y;x;p/to delete the associated index record .y;x;p/from the secondary
index (cf. Problem 11.5 ).
When the secondary index is under construction but not yet available, a transac-
tion inserting a tuple cannot insert the associated index record into the secondary
index, nor can a transaction deleting a tuple delete the associated index record from
the secondary index even if such a record already appeared in the index. When
the index construction is in progress, transactions can only append to the side file
records that describe secondary-index updates.
In the case of an insert action IŒx;y; v by transaction T on data page p,if
the index-record extraction process has not yet advanced past the primary key
x of the inserted tuple, T must not append anything to the side file, because in
that case the extraction process will capture the inserted tuple in its then current
page p 0 , create the index record .y;x;p 0 /, and store it on disk for insertion
into the index. Otherwise, if the extraction process has advanced past x, T must
append a record . ix-I ;y;x;p/ to the side file and log the append with a log
record
n 2 Wh T; append-to-side-file ;q; ix-I ;y;x;p;n 1 i ;
(11.1)
where q is the page-id of the side-file page that received the appended record.
Moreover, to make it possible for a later undo action by T to observe the index
record, the log record
n 2 Wh T; no-append-to-side-file ; ix-I ;y;x;p;n 1 i
(11.2)
must be written in the case that no record is appended to the side file.
Search WWH ::




Custom Search