Information Technology Reference
In-Depth Information
Algorithm 8.10
Procedure
redo-page-split
.r/
if
r is of the form “n Wh
page-split
;p;q;x
0
;q
0
;s
0
;V
0
;hi”
then
if
R
EC
-LSN.p/ n
then
fix-and-write-latch
.p/
if
page p is unmodified
then
R
EC
-LSN.p/ maxfR
EC
-LSN.p/; P
AGE
-LSN.p/C1g
end if
if
P
AGE
-LSN.p/ < n
then
insert the index record .x
0
;q
0
/ into page p
P
AGE
-LSN.p/ n
end if
unlatch-and-unfix
.p/
end if
if
R
EC
-LSN.q/ n
then
fix-and-write-latch
.q/
if
page q is unmodified
then
R
EC
-LSN.q/ maxfR
EC
-LSN.q/; P
AGE
-LSN.q/ C1g
end if
if
P
AGE
-LSN.q/ < n
then
delete from page q all records with keys x
0
P
AGE
-LSN.q/ n
end if
unlatch-and-unfix
.q/
end if
if
R
EC
-LSN.q
0
/ n
then
fix-and-write-latch
.q
0
/
if
page q
0
is unmodified
then
R
EC
-LSN.q
0
/ maxfR
EC
-LSN.q
0
/; P
AGE
-LSN.q
0
/C1g
end if
if
P
AGE
-LSN.q
0
/<n
then
format page q
0
as an empty B-tree page of height h
insert the records in V
0
into page q
0
P
AGE
-LSN.q
0
/ n
end if
unlatch-and-unfix
.q
0
/
end if
if
R
EC
-LSN.s
0
/ n
then
fix-and-write-latch
.s
0
/
if
page s
0
is unmodified
then
R
EC
-LSN.s
0
/ maxfR
EC
-LSN.s
0
/; P
AGE
-LSN.s
0
/C1g
end if
if
P
AGE
-LSN.s
0
/<n
then
mark page q
0
as allocated in page s
0
P
AGE
-LSN.s
0
/ n
end if
unlatch-and-unfix
.s
0
/
end if
end if