]> granicus.if.org Git - postgresql/commit
Modify RelationGetBufferForTuple() so that we only do lseek and lock
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 12 May 2001 19:58:28 +0000 (19:58 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 12 May 2001 19:58:28 +0000 (19:58 +0000)
commiteedb7d18fafdc1dfff61de0f0cfb2c19baeae361
treefc1370013a1762507764fd5317f4cea8c893c0a2
parentd9f55edc2cf704dfa51bdcede9b61ce69aa69234
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/backend/access/heap/heapam.c
src/backend/access/heap/hio.c
src/backend/storage/buffer/bufmgr.c
src/backend/storage/buffer/localbuf.c
src/include/storage/bufmgr.h