From eedb7d18fafdc1dfff61de0f0cfb2c19baeae361 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 12 May 2001 19:58:28 +0000 Subject: 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. --- src/include/storage/bufmgr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/include') diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h index fc76f9fe4c5..d45c8888c1d 100644 --- a/src/include/storage/bufmgr.h +++ b/src/include/storage/bufmgr.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: bufmgr.h,v 1.50 2001/03/22 04:01:05 momjian Exp $ + * $Id: bufmgr.h,v 1.51 2001/05/12 19:58:28 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -164,7 +164,7 @@ extern Buffer ReadBuffer(Relation reln, BlockNumber blockNum); extern int WriteBuffer(Buffer buffer); extern int WriteNoReleaseBuffer(Buffer buffer); extern Buffer ReleaseAndReadBuffer(Buffer buffer, Relation relation, - BlockNumber blockNum); + BlockNumber blockNum, bool isExtend); extern int FlushBuffer(Buffer buffer, bool sync, bool release); extern void InitBufferPool(void); -- cgit v1.2.3