Information Technology Reference
In-Depth Information
between the actions logged with
LSN
s 105 and 107. Note that p
1
was still a modified
page when the modified-page table was logged at
LSN
105. We also assume that in
the disk version of page p
2
,
P
AGE
-LSN
.p
2
/ < 101, meaning that the page was not
flushed onto disk after the actions logged with
LSN
s 112 and 117. Also note that
during taking the checkpoint, page p
2
, if buffered, was unmodified, since it does not
appear in the logged modified-page table.
During the log scan, the following actions are performed at
LSN
s 102-118:
102: Because
R
EC
-LSN
.p
1
/
D
102
102, the page p
1
must be fixed and write-
latched. The fixing brings page p
1
fromdisktothebuffer.The
P
AGE
-LSN
of the page
can now be examined. As the page is unmodified, we set
R
EC
-LSN
.p
1
/
max
f
R
EC
-LSN
.p
1
/;
P
AGE
-LSN
.p
1
/
C
1
g
D
max
f
102; 102
C
1
gD
103
in the modified-page table. Because
P
AGE
-LSN
.p
1
/
D
102
102,the
LSN
of the log
record, the result of the logged action DŒx
1
;
v
1
is already on the page. Page p
1
is
unlatched and unfixed.
103-106: No action.
107: Because
R
EC
-LSN
.p
1
/
D
103
107,pagep
1
is fixed and write-latched. As
the page is still unmodified, we again set
R
EC
-LSN
.p
1
/
102
C
1
D
103. Because
P
AGE
-LSN
.p
1
/
D
102 < 107, the result of the action IŒx
1
;
v
0
1
is missing from the
page. The tuple .x
1
;
v
0
1
/ is inserted into the page, and the
P
AGE
-LSN
is advanced:
P
AGE
-LSN
.p
1
/
107.Pagep
1
is unlatched and unfixed.
108-109: No action.
110: Because
R
EC
-LSN
.p
1
/
D
103
110,pagep
1
is fixed and write-
latched. As the page is no longer unmodified, its
R
EC
-LSN
is not updated. Because
P
AGE
-LSN
.p
1
/
D
107 < 110, the result of the action DŒx
1
;
v
0
1
is missing from
page p
1
. The tuple .x
1
;
v
0
1
/ is deleted from page p
1
and
P
AGE
-LSN
.p
1
/
110.
Page p
1
is unlatched and unfixed.
111: No action.
112: Because
R
EC
-LSN
.p
2
/
D
112
112,pagep
2
is fixed and write-latched.
The fixing brings page p
2
from disk to the buffer. As the page is unmodified, we set
R
EC
-LSN
.p
2
/
max
f
R
EC
-LSN
.p
2
/;
P
AGE
-LSN
.p
2
/
C
1
gD
112.
Recall that
P
AGE
-LSN
.p
2
/ < 101. Because
P
AGE
-LSN
.p
2
/ < 112, the result of the
action IŒx
2
;
v
2
is missing from the page. The tuple .x
2
;
v
2
/ is inserted into the page
and
P
AGE
-LSN
.p
2
/
112.Pagep
2
is unlatched and unfixed.
113: Because
R
EC
-LSN
.p
1
/
D
103
113,pagep
1
is fixed and write-latched.
Because
P
AGE
-LSN
.p
1
/
D
110 < 113, the result of the action IŒx
3
;
v
3
is missing
from the page. The tuple .x
3
;
v
3
/ is inserted into the page and
P
AGE
-LSN
.p
1
/
113.
Page p
1
is unfixed and unlatched.
114: No action.
115: Because
R
EC
-LSN
.p
1
/
D
103
115,pagep
1
is fixed and write-latched.
Because
P
AGE
-LSN
.p
1
/
D
113 < 115, the result of the action I
1
Œx
3
;
v
3
is missing
from the page. The tuple .x
3
;
v
3
/ is deleted from the page and
P
AGE
-LSN
.p
1
/
115.
Page p
1
is unlatched and unfixed.