Allow tupleslots to have a fixed tupledesc, use in executor nodes

Enterprise / PostgreSQL - Andres Freund [anarazel.de] - 17 February 2018 05:17 EST

The reason for doing so is that it will allow expression evaluation to optimize based on the underlying tupledesc. In particular it will allow to JIT tuple deforming together with the expression itself.

For that expression initialization needs to be moved after the relevant slots are initialized - mostly unproblematic, except in the case of nodeWorktablescan.c.

After doing so there's no need for ExecAssignResultType() and ExecAssignResultTypeFromTL() anymore, as all former callers have been converted to create a slot with a fixed descriptor.

When creating a slot with a fixed descriptor, tts_values/isnull can be allocated together with the main slot, reducing allocation overhead and increasing cache density a bit.

Author: Andres Freund Discussion: https://postgr.es/m/20171206093717.vqdxe5icqttpxs3p@alap3.anarazel.de

ad7dbee368 Allow tupleslots to have a fixed tupledesc, use in executor nodes.
src/backend/commands/copy.c | 5 +-
src/backend/commands/trigger.c | 6 +-
src/backend/executor/README | 2 +
src/backend/executor/execExpr.c | 2 +-
src/backend/executor/execMain.c | 2 +-
src/backend/executor/execPartition.c | 4 +-
src/backend/executor/execScan.c | 2 +-
src/backend/executor/execTuples.c | 114 ++++++++++++++++++-------
src/backend/executor/execUtils.c | 62 ++------------
src/backend/executor/nodeAgg.c | 62 ++++++--------
src/backend/executor/nodeAppend.c | 18 ++--
src/backend/executor/nodeBitmapAnd.c | 14 +--
src/backend/executor/nodeBitmapHeapscan.c | 56 ++++++------
src/backend/executor/nodeBitmapIndexscan.c | 18 ++--
src/backend/executor/nodeBitmapOr.c | 14 +--
src/backend/executor/nodeCtescan.c | 26 +++---
src/backend/executor/nodeCustom.c | 20 ++---
src/backend/executor/nodeForeignscan.c | 30 +++----
src/backend/executor/nodeFunctionscan.c | 30 +++----
src/backend/executor/nodeGather.c | 31 +++----
src/backend/executor/nodeGatherMerge.c | 19 ++---
src/backend/executor/nodeGroup.c | 26 +++---
src/backend/executor/nodeHash.c | 23 ++---
src/backend/executor/nodeHashjoin.c | 49 +++++------
src/backend/executor/nodeIndexonlyscan.c | 34 +++-----
src/backend/executor/nodeIndexscan.c | 45 +++++-----
src/backend/executor/nodeLimit.c | 18 ++--
src/backend/executor/nodeLockRows.c | 9 +-
src/backend/executor/nodeMaterial.c | 22 +++--
src/backend/executor/nodeMergeAppend.c | 6 +-
src/backend/executor/nodeMergejoin.c | 53 ++++++------
src/backend/executor/nodeModifyTable.c | 25 +++---
src/backend/executor/nodeNamedtuplestorescan.c | 21 ++---
src/backend/executor/nodeNestloop.c | 29 +++----
src/backend/executor/nodeProjectSet.c | 14 +--
src/backend/executor/nodeRecursiveunion.c | 9 +-
src/backend/executor/nodeResult.c | 25 +++---
src/backend/executor/nodeSamplescan.c | 70 ++++++---------
src/backend/executor/nodeSeqscan.c | 56 ++++--------
src/backend/executor/nodeSetOp.c | 11 +--
src/backend/executor/nodeSort.c | 18 ++--
src/backend/executor/nodeSubplan.c | 6 +-
src/backend/executor/nodeSubqueryscan.c | 28 +++---
src/backend/executor/nodeTableFuncscan.c | 26 +++---
src/backend/executor/nodeTidscan.c | 29 +++----
src/backend/executor/nodeUnique.c | 11 +--
src/backend/executor/nodeValuesscan.c | 25 ++----
src/backend/executor/nodeWindowAgg.c | 65 ++++++--------
src/backend/executor/nodeWorktablescan.c | 16 ++--
src/backend/replication/logical/worker.c | 22 ++---
src/include/executor/executor.h | 11 ++-
src/include/executor/tuptable.h | 5 +-
52 files changed, 566 insertions(+), 778 deletions(-)

Upstream: git.postgresql.org


  • Share