mirror of
https://github.com/postgres/postgres.git
synced 2025-10-16 17:07:43 +03:00
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.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.113 2001/03/25 23:23:58 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.114 2001/05/12 19:58:27 tgl Exp $
|
||||
*
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
@@ -487,7 +487,7 @@ heapgettup(Relation relation,
|
||||
return;
|
||||
}
|
||||
|
||||
*buffer = ReleaseAndReadBuffer(*buffer, relation, page);
|
||||
*buffer = ReleaseAndReadBuffer(*buffer, relation, page, false);
|
||||
|
||||
if (!BufferIsValid(*buffer))
|
||||
elog(ERROR, "heapgettup: failed ReadBuffer");
|
||||
|
Reference in New Issue
Block a user