diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-08-06 02:36:35 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-08-06 02:36:35 +0000 |
| commit | 5df307c7782518c4a3c19ffd05c7cb591b97e23c (patch) | |
| tree | 0ff988dc5b7b115e9f6bbf29852dd4bad7fcaeea /src/backend/access/nbtree/nbtpage.c | |
| parent | 35cd432b185938c33967c9fa48223ce33e1c66bd (diff) | |
| download | postgresql-5df307c7782518c4a3c19ffd05c7cb591b97e23c.tar.gz | |
Restructure local-buffer handling per recent pghackers discussion.
The local buffer manager is no longer used for newly-created relations
(unless they are TEMP); a new non-TEMP relation goes through the shared
bufmgr and thus will participate normally in checkpoints. But TEMP relations
use the local buffer manager throughout their lifespan. Also, operations
in TEMP relations are not logged in WAL, thus improving performance.
Since it's no longer necessary to fsync relations as they move out of the
local buffers into shared buffers, quite a lot of smgr.c/md.c/fd.c code
is no longer needed and has been removed: there's no concept of a dirty
relation anymore in md.c/fd.c, and we never fsync anything but WAL.
Still TODO: improve local buffer management algorithms so that it would
be reasonable to increase NLocBuffer.
Diffstat (limited to 'src/backend/access/nbtree/nbtpage.c')
| -rw-r--r-- | src/backend/access/nbtree/nbtpage.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index 386cb6a07a..110de69406 100644 --- a/src/backend/access/nbtree/nbtpage.c +++ b/src/backend/access/nbtree/nbtpage.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.57 2002/06/20 20:29:25 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.58 2002/08/06 02:36:33 tgl Exp $ * * NOTES * Postgres btree pages look like ordinary relation pages. The opaque @@ -173,6 +173,7 @@ _bt_getroot(Relation rel, int access) rootopaque->btpo_flags |= (BTP_LEAF | BTP_ROOT); /* XLOG stuff */ + if (!rel->rd_istemp) { xl_btree_newroot xlrec; XLogRecPtr recptr; @@ -187,7 +188,8 @@ _bt_getroot(Relation rel, int access) rdata.next = NULL; recptr = XLogInsert(RM_BTREE_ID, - XLOG_BTREE_NEWROOT | XLOG_BTREE_LEAF, &rdata); + XLOG_BTREE_NEWROOT | XLOG_BTREE_LEAF, + &rdata); PageSetLSN(rootpage, recptr); PageSetSUI(rootpage, ThisStartUpID); @@ -457,6 +459,7 @@ _bt_itemdel(Relation rel, Buffer buf, ItemPointer tid) PageIndexTupleDelete(page, offno); /* XLOG stuff */ + if (!rel->rd_istemp) { xl_btree_delete xlrec; XLogRecPtr recptr; |
