Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
database cluster
WAL buffer
WAL segments Last XLOG record
shared buffer pool
© Copyright 2015 Suzuki Hironobu All Rights R...
database cluster
WAL buffer
WAL segments
(1)
CHECKPOINT
REDO point
checkpoint
CHECKPOINT
CHECKPOINT
REDO point
checkpoint
...
TABLE_Adatabase cluster
WAL buffer
WAL segments
(1)
CHECKPOINT
LSN_0
REDO point
checkpoint
CHECKPOINT
CHECKPOINT
REDO poin...
TABLE_Adatabase cluster
WAL buffer
WAL segments
(1)
CHECKPOINT
LSN_0
TABLE_A
LSN_0
REDO point
checkpoint
CHECKPOINT
CHECKP...
TABLE_A
A
(2)
BEGIN;
INSERT INTO TABLE_A VALUES('A');
database cluster
WAL buffer
WAL segments
(1)
CHECKPOINT
LSN_0
LSN_0
...
TABLE_A
A
(2)
BEGIN;
INSERT INTO TABLE_A VALUES('A');
database cluster
WAL buffer
WAL segments
A
(1)
CHECKPOINT
LSN_0
LSN_...
TABLE_A
A
(2) (3)
BEGIN;
INSERT INTO TABLE_A VALUES('A');
COMMIT;
database cluster
WAL buffer
WAL segments
A
(1)
CHECKPOIN...
TABLE_A
A
(2) (3)
BEGIN;
INSERT INTO TABLE_A VALUES('A');
COMMIT;
database cluster
WAL buffer
WAL segments
A
(1)
CHECKPOIN...
TABLE_A
A
(2) (3)
BEGIN;
INSERT INTO TABLE_A VALUES('A');
COMMIT;
database cluster
WAL buffer
WAL segments
A
A
(1)
CHECKPO...
TABLE_A
A
(2) (3)
BEGIN;
INSERT INTO TABLE_A VALUES('A');
COMMIT;
database cluster
WAL buffer
WAL segments
A
A
(1)
CHECKPO...
TABLE_A
A
(2) (3)
BEGIN;
INSERT INTO TABLE_A VALUES('A');
COMMIT;
database cluster
WAL buffer
WAL segments
A
A
(1)
CHECKPO...
TABLE_A
A
(2) (3)
BEGIN;
INSERT INTO TABLE_A VALUES('A');
COMMIT;
database cluster
WAL buffer
WAL segments
A
A
(1)
CHECKPO...
TABLE_A
A
(2) (3)
BEGIN;
INSERT INTO TABLE_A VALUES('A');
COMMIT;
database cluster
WAL buffer
WAL segments
A
A
(1)
CHECKPO...
TABLE_A
A
(2) (3)
BEGIN;
INSERT INTO TABLE_A VALUES('A');
COMMIT;
database cluster
WAL buffer
WAL segments
A
A
(1)
CHECKPO...
TABLE_A
A
(2) (3)
BEGIN;
INSERT INTO TABLE_A VALUES('A');
COMMIT;
database cluster
WAL buffer
WAL segments
A
A
(1)
CHECKPO...
Upcoming SlideShare
Loading in …5
×

Fig 9-02

781 views

Published on

Insertion operation with WAL

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Fig 9-02

  1. 1. database cluster WAL buffer WAL segments Last XLOG record shared buffer pool © Copyright 2015 Suzuki Hironobu All Rights Reserved. See also http://www.interdb.jp/pg/pgsql09.html
  2. 2. database cluster WAL buffer WAL segments (1) CHECKPOINT REDO point checkpoint CHECKPOINT CHECKPOINT REDO point checkpoint Last XLOG record shared buffer pool Do checkpoint © Copyright 2015 Suzuki Hironobu All Rights Reserved. See also http://www.interdb.jp/pg/pgsql09.html
  3. 3. TABLE_Adatabase cluster WAL buffer WAL segments (1) CHECKPOINT LSN_0 REDO point checkpoint CHECKPOINT CHECKPOINT REDO point checkpoint Last XLOG record shared buffer pool (2) BEGIN; INSERT INTO TABLE_A VALUES('A'); Issue the first INSERT statement © Copyright 2015 Suzuki Hironobu All Rights Reserved. See also http://www.interdb.jp/pg/pgsql09.html
  4. 4. TABLE_Adatabase cluster WAL buffer WAL segments (1) CHECKPOINT LSN_0 TABLE_A LSN_0 REDO point checkpoint CHECKPOINT CHECKPOINT REDO point checkpoint Last XLOG record shared buffer pool (2) BEGIN; INSERT INTO TABLE_A VALUES('A'); Load the TABLE_A's page © Copyright 2015 Suzuki Hironobu All Rights Reserved. See also http://www.interdb.jp/pg/pgsql09.html
  5. 5. TABLE_A A (2) BEGIN; INSERT INTO TABLE_A VALUES('A'); database cluster WAL buffer WAL segments (1) CHECKPOINT LSN_0 LSN_0 TABLE_A LSN_0 REDO point checkpoint CHECKPOINT CHECKPOINT REDO point checkpoint Last XLOG record shared buffer pool Insert a tuple © Copyright 2015 Suzuki Hironobu All Rights Reserved. See also http://www.interdb.jp/pg/pgsql09.html
  6. 6. TABLE_A A (2) BEGIN; INSERT INTO TABLE_A VALUES('A'); database cluster WAL buffer WAL segments A (1) CHECKPOINT LSN_0 LSN_0 TABLE_A LSN_0 REDO point checkpoint CHECKPOINT LSN_1 CHECKPOINT REDO point checkpoint Last XLOG record shared buffer pool Write the XLOG record of this tuple to the WAL buffer © Copyright 2015 Suzuki Hironobu All Rights Reserved. See also http://www.interdb.jp/pg/pgsql09.html
  7. 7. TABLE_A A (2) (3) BEGIN; INSERT INTO TABLE_A VALUES('A'); COMMIT; database cluster WAL buffer WAL segments A (1) CHECKPOINT LSN_0 LSN_0 TABLE_A LSN_0 REDO point checkpoint CHECKPOINT LSN_1 CHECKPOINT REDO point checkpoint Last XLOG record shared buffer pool Invoke a commit action © Copyright 2015 Suzuki Hironobu All Rights Reserved. See also http://www.interdb.jp/pg/pgsql09.html
  8. 8. TABLE_A A (2) (3) BEGIN; INSERT INTO TABLE_A VALUES('A'); COMMIT; database cluster WAL buffer WAL segments A (1) CHECKPOINT LSN_0 LSN_0 TABLE_A LSN_0 COMMIT REDO point checkpoint CHECKPOINT LSN_1 CHECKPOINT REDO point checkpoint Last XLOG record shared buffer pool Write the XLOG record of this commit action © Copyright 2015 Suzuki Hironobu All Rights Reserved. See also http://www.interdb.jp/pg/pgsql09.html
  9. 9. TABLE_A A (2) (3) BEGIN; INSERT INTO TABLE_A VALUES('A'); COMMIT; database cluster WAL buffer WAL segments A A (1) CHECKPOINT LSN_1 LSN_0 LSN_0 TABLE_A LSN_0 COMMIT COMMIT REDO point checkpoint CHECKPOINT LSN_1 CHECKPOINT REDO point checkpoint Last XLOG record shared buffer pool Write and flush the XLOG records to WAL segment © Copyright 2015 Suzuki Hironobu All Rights Reserved. See also http://www.interdb.jp/pg/pgsql09.html
  10. 10. TABLE_A A (2) (3) BEGIN; INSERT INTO TABLE_A VALUES('A'); COMMIT; database cluster WAL buffer WAL segments A A (1) CHECKPOINT LSN_1 LSN_0 LSN_0 LSN_1 TABLE_A LSN_0 COMMIT COMMIT REDO point checkpoint CHECKPOINT LSN_1 CHECKPOINT REDO point checkpoint Last XLOG record shared buffer pool Update TABLE_A's pd_lsn from LSN_0 to LSN_1 © Copyright 2015 Suzuki Hironobu All Rights Reserved. See also http://www.interdb.jp/pg/pgsql09.html
  11. 11. TABLE_A A (2) (3) BEGIN; INSERT INTO TABLE_A VALUES('A'); COMMIT; database cluster WAL buffer WAL segments A A (1) CHECKPOINT LSN_1 LSN_0 LSN_0 LSN_1 TABLE_A LSN_0 COMMIT COMMIT REDO point checkpoint CHECKPOINT LSN_1 CHECKPOINT REDO point checkpoint Last XLOG record B A (4) BEGIN; INSERT INTO TABLE_A VALUES('B'); B LSN_1 LSN_2 shared buffer pool Issue the second statement and write a XLOG record © Copyright 2015 Suzuki Hironobu All Rights Reserved. See also http://www.interdb.jp/pg/pgsql09.html
  12. 12. TABLE_A A (2) (3) BEGIN; INSERT INTO TABLE_A VALUES('A'); COMMIT; database cluster WAL buffer WAL segments A A (1) CHECKPOINT LSN_1 LSN_0 LSN_0 LSN_1 TABLE_A LSN_0 COMMIT COMMIT REDO point checkpoint CHECKPOINT LSN_1 CHECKPOINT REDO point checkpoint Last XLOG record B A (4) (5) BEGIN; INSERT INTO TABLE_A VALUES('B'); COMMIT; B LSN_1 LSN_2 shared buffer pool Invoke a commit action © Copyright 2015 Suzuki Hironobu All Rights Reserved. See also http://www.interdb.jp/pg/pgsql09.html
  13. 13. TABLE_A A (2) (3) BEGIN; INSERT INTO TABLE_A VALUES('A'); COMMIT; database cluster WAL buffer WAL segments A A (1) CHECKPOINT LSN_1 LSN_0 LSN_0 LSN_1 TABLE_A LSN_0 COMMIT COMMIT REDO point checkpoint CHECKPOINT LSN_1 CHECKPOINT REDO point checkpoint Last XLOG record B A (4) (5) BEGIN; INSERT INTO TABLE_A VALUES('B'); COMMIT; B LSN_1 COMMIT LSN_2 shared buffer pool Write the XLOG record of this commit action © Copyright 2015 Suzuki Hironobu All Rights Reserved. See also http://www.interdb.jp/pg/pgsql09.html
  14. 14. TABLE_A A (2) (3) BEGIN; INSERT INTO TABLE_A VALUES('A'); COMMIT; database cluster WAL buffer WAL segments A A (1) CHECKPOINT LSN_1 LSN_0 LSN_0 LSN_1 TABLE_A LSN_0 COMMIT COMMIT REDO point checkpoint CHECKPOINT LSN_1 CHECKPOINT REDO point checkpoint Last XLOG record B A (4) (5) BEGIN; INSERT INTO TABLE_A VALUES('B'); COMMIT; B B LSN_2 LSN_1 COMMIT COMMIT LSN_2 shared buffer pool Write and flush XLOG records to the WAL segment © Copyright 2015 Suzuki Hironobu All Rights Reserved. See also http://www.interdb.jp/pg/pgsql09.html
  15. 15. TABLE_A A (2) (3) BEGIN; INSERT INTO TABLE_A VALUES('A'); COMMIT; database cluster WAL buffer WAL segments A A (1) CHECKPOINT LSN_1 LSN_0 LSN_0 LSN_1 TABLE_A LSN_0 COMMIT COMMIT REDO point checkpoint CHECKPOINT LSN_1 CHECKPOINT REDO point checkpoint Last XLOG record B A (4) (5) BEGIN; INSERT INTO TABLE_A VALUES('B'); COMMIT; B B LSN_2 LSN_1 LSN_2 COMMIT COMMIT LSN_2 shared buffer pool Update TABLE_A's pd_lsn from LSN_1 to LSN_2 © Copyright 2015 Suzuki Hironobu All Rights Reserved. See also http://www.interdb.jp/pg/pgsql09.html

×