1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-11 20:28:21 +03:00

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

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
This commit is contained in:
Andres Freund
2018-02-16 21:17:38 -08:00
parent bf6c614a2f
commit ad7dbee368
52 changed files with 579 additions and 791 deletions

View File

@ -370,13 +370,15 @@ ExecInitLockRows(LockRows *node, EState *estate, int eflags)
/*
* Miscellaneous initialization
*
* LockRows nodes never call ExecQual or ExecProject.
* LockRows nodes never call ExecQual or ExecProject, therefore no
* ExprContext is needed.
*/
/*
* Tuple table initialization (XXX not actually used...)
* Tuple table initialization (XXX not actually used, but upper nodes
* access it to get this node's result tupledesc...)
*/
ExecInitResultTupleSlot(estate, &lrstate->ps);
ExecInitResultTupleSlotTL(estate, &lrstate->ps);
/*
* then initialize outer plan
@ -387,7 +389,6 @@ ExecInitLockRows(LockRows *node, EState *estate, int eflags)
* LockRows nodes do no projections, so initialize projection info for
* this node appropriately
*/
ExecAssignResultTypeFromTL(&lrstate->ps);
lrstate->ps.ps_ProjInfo = NULL;
/*