OSDN Git Service

Improve ExecStoreTuple to be smarter about replacing the contents of
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 25 Nov 2005 04:24:48 +0000 (04:24 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 25 Nov 2005 04:24:48 +0000 (04:24 +0000)
commitdab52ab13d3d3cce26e9bcc3193eb285c195d430
treed7b4ebc7af6d4e09341637179e46d212c69070af
parentc0a2f8cc4decba933f0ebb6d5b4ffd9eca036a78
Improve ExecStoreTuple to be smarter about replacing the contents of
a TupleTableSlot: instead of calling ExecClearTuple, inline the needed
operations, so that we can avoid redundant steps.  In particular, when
the old and new tuples are both on the same disk page, avoid releasing
and re-acquiring the buffer pin --- this saves work in both the bufmgr
and ResourceOwner modules.  To make this improvement actually useful,
partially revert a change I made on 2004-04-21 that caused SeqNext
et al to call ExecClearTuple before ExecStoreTuple.  The motivation
for that, to avoid grabbing the BufMgrLock separately for releasing
the old buffer and grabbing the new one, no longer applies.  My
profiling says that this saves about 5% of the CPU time for an
all-in-memory seqscan.
src/backend/executor/execTuples.c
src/backend/executor/nodeBitmapHeapscan.c
src/backend/executor/nodeIndexscan.c
src/backend/executor/nodeSeqscan.c
src/backend/executor/nodeTidscan.c