Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit21fda22

Browse files
committed
Change CRCs in WAL records from 64bit to 32bit for performance reasons.
Instead of a separate CRC on each backup block, include backup blocksin their parent WAL record's CRC; this is important to ensure that thebackup block really goes with the WAL record, ie there was not a pagetear right at the start of the backup block. Implement a simple formof compression of backup blocks: drop any run of zeroes starting atpd_lower, so as not to store the unused 'hole' that commonly exists inPG heap and index pages. Tweak PageRepairFragmentation and relatedroutines to ensure they keep the unused space zeroed, so that the abovecompression method remains effective. All per recent discussions.
1 parentc196c7a commit21fda22

File tree

11 files changed

+511
-207
lines changed

11 files changed

+511
-207
lines changed

‎src/backend/access/nbtree/nbtpage.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtpage.c,v 1.84 2005/05/07 21:32:23 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtpage.c,v 1.85 2005/06/02 05:55:28 tgl Exp $
1313
*
1414
*NOTES
1515
* Postgres btree pages look like ordinary relation pages.The opaque
@@ -113,6 +113,13 @@ _bt_initmetapage(Page page, BlockNumber rootbknum, uint32 level)
113113

114114
metaopaque= (BTPageOpaque)PageGetSpecialPointer(page);
115115
metaopaque->btpo_flags=BTP_META;
116+
117+
/*
118+
* Set pd_lower just past the end of the metadata. This is not
119+
* essential but it makes the page look compressible to xlog.c.
120+
*/
121+
((PageHeader)page)->pd_lower=
122+
((char*)metad+sizeof(BTMetaPageData))- (char*)page;
116123
}
117124

118125
/*

‎src/backend/access/nbtree/nbtxlog.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.20 2005/03/22 06:17:03 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.21 2005/06/02 05:55:28 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -135,6 +135,13 @@ _bt_restore_meta(Relation reln, XLogRecPtr lsn,
135135
pageop= (BTPageOpaque)PageGetSpecialPointer(metapg);
136136
pageop->btpo_flags=BTP_META;
137137

138+
/*
139+
* Set pd_lower just past the end of the metadata. This is not
140+
* essential but it makes the page look compressible to xlog.c.
141+
*/
142+
((PageHeader)metapg)->pd_lower=
143+
((char*)md+sizeof(BTMetaPageData))- (char*)metapg;
144+
138145
PageSetLSN(metapg,lsn);
139146
PageSetTLI(metapg,ThisTimeLineID);
140147
LockBuffer(metabuf,BUFFER_LOCK_UNLOCK);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp