aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/localbuf.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-05-12 19:58:28 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-05-12 19:58:28 +0000
commiteedb7d18fafdc1dfff61de0f0cfb2c19baeae361 (patch)
treefc1370013a1762507764fd5317f4cea8c893c0a2 /src/backend/storage/buffer/localbuf.c
parentd9f55edc2cf704dfa51bdcede9b61ce69aa69234 (diff)
downloadpostgresql-eedb7d18fafdc1dfff61de0f0cfb2c19baeae361.tar.gz
postgresql-eedb7d18fafdc1dfff61de0f0cfb2c19baeae361.zip
Modify RelationGetBufferForTuple() so that we only do lseek and lock
when we need to move to a new page; as long as we can insert the new tuple on the same page as before, we only need LockBuffer and not the expensive stuff. Also, twiddle bufmgr interfaces to avoid redundant lseeks in RelationGetBufferForTuple and BufferAlloc. Successive inserts now require one lseek per page added, rather than one per tuple with several additional ones at each page boundary as happened before. Lock contention when multiple backends are inserting in same table is also greatly reduced.
Diffstat (limited to 'src/backend/storage/buffer/localbuf.c')
-rw-r--r--src/backend/storage/buffer/localbuf.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c
index 6e3cd756411..4b4a31066b2 100644
--- a/src/backend/storage/buffer/localbuf.c
+++ b/src/backend/storage/buffer/localbuf.c
@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.40 2001/03/22 03:59:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.41 2001/05/12 19:58:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -54,12 +54,6 @@ LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr)
int i;
BufferDesc *bufHdr = (BufferDesc *) NULL;
- if (blockNum == P_NEW)
- {
- blockNum = reln->rd_nblocks;
- reln->rd_nblocks++;
- }
-
/* a low tech search for now -- not optimized for scans */
for (i = 0; i < NLocBuffer; i++)
{