mirror of
https://github.com/postgres/postgres.git
synced 2025-11-25 12:03:53 +03:00
Adjust btree index build to not use shared buffers, thereby avoiding the
locking conflict against concurrent CHECKPOINT that was discussed a few weeks ago. Also, if not using WAL archiving (which is always true ATM but won't be if PITR makes it into this release), there's no need to WAL-log the index build process; it's sufficient to force-fsync the completed index before commit. This seems to gain about a factor of 2 in my tests, which is consistent with writing half as much data. I did not try it with WAL on a separate drive though --- probably the gain would be a lot less in that scenario.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/storage/smgr.h,v 1.43 2004/05/31 20:31:33 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/include/storage/smgr.h,v 1.44 2004/06/02 17:28:18 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -63,6 +63,7 @@ extern void smgrwrite(SMgrRelation reln, BlockNumber blocknum, char *buffer,
|
||||
extern BlockNumber smgrnblocks(SMgrRelation reln);
|
||||
extern BlockNumber smgrtruncate(SMgrRelation reln, BlockNumber nblocks,
|
||||
bool isTemp);
|
||||
extern void smgrimmedsync(SMgrRelation reln);
|
||||
extern void smgrDoPendingDeletes(bool isCommit);
|
||||
extern int smgrGetPendingDeletes(bool forCommit, RelFileNode **ptr);
|
||||
extern void smgrcommit(void);
|
||||
@@ -89,6 +90,7 @@ extern bool mdwrite(SMgrRelation reln, BlockNumber blocknum, char *buffer,
|
||||
extern BlockNumber mdnblocks(SMgrRelation reln);
|
||||
extern BlockNumber mdtruncate(SMgrRelation reln, BlockNumber nblocks,
|
||||
bool isTemp);
|
||||
extern bool mdimmedsync(SMgrRelation reln);
|
||||
extern bool mdsync(void);
|
||||
|
||||
extern void RememberFsyncRequest(RelFileNode rnode, BlockNumber segno);
|
||||
|
||||
Reference in New Issue
Block a user