Skip site navigation (1) Skip section navigation (2)

pgsql: Revise TupleTableSlot code to avoid unnecessary construction and

From: tgl(at)svr1(dot)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Revise TupleTableSlot code to avoid unnecessary construction and
Date: 2005-03-16 21:38:10
Message-ID: 20050316213810.41C63569BB@svr1.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Revise TupleTableSlot code to avoid unnecessary construction and disassembly
of tuples when passing data up through multiple plan nodes.  A slot can now
hold either a normal "physical" HeapTuple, or a "virtual" tuple consisting
of Datum/isnull arrays.  Upper plan levels can usually just copy the Datum
arrays, avoiding heap_formtuple() and possible subsequent nocachegetattr()
calls to extract the data again.  This work extends Atsushi Ogawa's earlier
patch, which provided the key idea of adding Datum arrays to TupleTableSlots.
(I believe however that something like this was foreseen way back in Berkeley
days --- see the old comment on ExecProject.)  A test case involving many
levels of join of fairly wide tables (about 80 columns altogether) showed
about 3x overall speedup, though simple queries will probably not be
helped very much.

I have also duplicated some code in heaptuple.c in order to provide versions
of heap_formtuple and friends that use "bool" arrays to indicate null
attributes, instead of the old convention of "char" arrays containing either
'n' or ' '.  This provides a better match to the convention used by
ExecEvalExpr.  While I have not made a concerted effort to get rid of uses
of the old routines, I think they should be deprecated and eventually removed.

Modified Files:
--------------
    pgsql/doc/src/sgml:
        xfunc.sgml (r1.100 -> r1.101)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/xfunc.sgml.diff?r1=1.100&r2=1.101)
    pgsql/src/backend/access/common:
        heaptuple.c (r1.97 -> r1.98)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/common/heaptuple.c.diff?r1=1.97&r2=1.98)
        printtup.c (r1.86 -> r1.87)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/common/printtup.c.diff?r1=1.86&r2=1.87)
    pgsql/src/backend/catalog:
        index.c (r1.246 -> r1.247)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/index.c.diff?r1=1.246&r2=1.247)
        indexing.c (r1.107 -> r1.108)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/indexing.c.diff?r1=1.107&r2=1.108)
    pgsql/src/backend/commands:
        analyze.c (r1.82 -> r1.83)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/analyze.c.diff?r1=1.82&r2=1.83)
        copy.c (r1.237 -> r1.238)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/copy.c.diff?r1=1.237&r2=1.238)
        tablecmds.c (r1.146 -> r1.147)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/tablecmds.c.diff?r1=1.146&r2=1.147)
        vacuum.c (r1.303 -> r1.304)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/vacuum.c.diff?r1=1.303&r2=1.304)
    pgsql/src/backend/executor:
        execGrouping.c (r1.13 -> r1.14)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execGrouping.c.diff?r1=1.13&r2=1.14)
        execJunk.c (r1.47 -> r1.48)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execJunk.c.diff?r1=1.47&r2=1.48)
        execMain.c (r1.241 -> r1.242)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execMain.c.diff?r1=1.241&r2=1.242)
        execQual.c (r1.172 -> r1.173)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execQual.c.diff?r1=1.172&r2=1.173)
        execScan.c (r1.34 -> r1.35)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execScan.c.diff?r1=1.34&r2=1.35)
        execTuples.c (r1.84 -> r1.85)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execTuples.c.diff?r1=1.84&r2=1.85)
        execUtils.c (r1.117 -> r1.118)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execUtils.c.diff?r1=1.117&r2=1.118)
        functions.c (r1.91 -> r1.92)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/functions.c.diff?r1=1.91&r2=1.92)
        nodeAgg.c (r1.129 -> r1.130)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeAgg.c.diff?r1=1.129&r2=1.130)
        nodeFunctionscan.c (r1.30 -> r1.31)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeFunctionscan.c.diff?r1=1.30&r2=1.31)
        nodeGroup.c (r1.60 -> r1.61)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeGroup.c.diff?r1=1.60&r2=1.61)
        nodeHash.c (r1.90 -> r1.91)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeHash.c.diff?r1=1.90&r2=1.91)
        nodeHashjoin.c (r1.68 -> r1.69)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeHashjoin.c.diff?r1=1.68&r2=1.69)
        nodeIndexscan.c (r1.99 -> r1.100)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeIndexscan.c.diff?r1=1.99&r2=1.100)
        nodeLimit.c (r1.20 -> r1.21)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeLimit.c.diff?r1=1.20&r2=1.21)
        nodeMaterial.c (r1.48 -> r1.49)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeMaterial.c.diff?r1=1.48&r2=1.49)
        nodeMergejoin.c (r1.69 -> r1.70)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeMergejoin.c.diff?r1=1.69&r2=1.70)
        nodeSeqscan.c (r1.51 -> r1.52)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeSeqscan.c.diff?r1=1.51&r2=1.52)
        nodeSetOp.c (r1.15 -> r1.16)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeSetOp.c.diff?r1=1.15&r2=1.16)
        nodeSort.c (r1.49 -> r1.50)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeSort.c.diff?r1=1.49&r2=1.50)
        nodeSubplan.c (r1.66 -> r1.67)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeSubplan.c.diff?r1=1.66&r2=1.67)
        nodeUnique.c (r1.45 -> r1.46)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeUnique.c.diff?r1=1.45&r2=1.46)
        spi.c (r1.134 -> r1.135)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/spi.c.diff?r1=1.134&r2=1.135)
        tstoreReceiver.c (r1.13 -> r1.14)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/tstoreReceiver.c.diff?r1=1.13&r2=1.14)
    pgsql/src/backend/nodes:
        print.c (r1.72 -> r1.73)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/print.c.diff?r1=1.72&r2=1.73)
    pgsql/src/backend/tcop:
        dest.c (r1.64 -> r1.65)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/dest.c.diff?r1=1.64&r2=1.65)
        pquery.c (r1.91 -> r1.92)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/pquery.c.diff?r1=1.91&r2=1.92)
    pgsql/src/include/access:
        heapam.h (r1.95 -> r1.96)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/access/heapam.h.diff?r1=1.95&r2=1.96)
        printtup.h (r1.32 -> r1.33)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/access/printtup.h.diff?r1=1.32&r2=1.33)
    pgsql/src/include/catalog:
        index.h (r1.59 -> r1.60)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/index.h.diff?r1=1.59&r2=1.60)
    pgsql/src/include/executor:
        execdebug.h (r1.25 -> r1.26)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/execdebug.h.diff?r1=1.25&r2=1.26)
        executor.h (r1.116 -> r1.117)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/executor.h.diff?r1=1.116&r2=1.117)
        tuptable.h (r1.27 -> r1.28)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/tuptable.h.diff?r1=1.27&r2=1.28)
    pgsql/src/include/nodes:
        execnodes.h (r1.123 -> r1.124)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/execnodes.h.diff?r1=1.123&r2=1.124)
    pgsql/src/include/tcop:
        dest.h (r1.45 -> r1.46)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/tcop/dest.h.diff?r1=1.45&r2=1.46)

pgsql-committers by date

Next:From: Bruce MomjianDate: 2005-03-16 22:59:42
Subject: pgsql: Force initdb cause of encoding additions.
Previous:From: Bruce MomjianDate: 2005-03-16 21:27:23
Subject: pgsql: Add sprintf support, that were were missing.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group