pgsql: Improve ExecStoreTuple to be smarter about replacing the contents

From: tgl(at)svr1(dot)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve ExecStoreTuple to be smarter about replacing the contents
Date: 2005-11-25 04:24:48
Message-ID: 20051125042448.ED9ABDBABE@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
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.

Modified Files:
--------------
pgsql/src/backend/executor:
execTuples.c (r1.89 -> r1.90)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execTuples.c.diff?r1=1.89&r2=1.90)
nodeBitmapHeapscan.c (r1.4 -> r1.5)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeBitmapHeapscan.c.diff?r1=1.4&r2=1.5)
nodeIndexscan.c (r1.105 -> r1.106)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeIndexscan.c.diff?r1=1.105&r2=1.106)
nodeSeqscan.c (r1.54 -> r1.55)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeSeqscan.c.diff?r1=1.54&r2=1.55)
nodeTidscan.c (r1.43 -> r1.44)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeTidscan.c.diff?r1=1.43&r2=1.44)

Browse pgsql-committers by date

  From Date Subject
Next Message User Chriskl 2005-11-25 05:54:05 mysqlcompat - mysqlcompat: Add <=> null safe comparison.
Previous Message User Gsmet 2005-11-25 00:18:09 pgfouine - pgfouine: removed debug