mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +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:
@ -226,6 +226,15 @@ ExecInitBitmapIndexScan(BitmapIndexScan *node, EState *estate, int eflags)
|
||||
/* normally we don't make the result bitmap till runtime */
|
||||
indexstate->biss_result = NULL;
|
||||
|
||||
/*
|
||||
* We do not open or lock the base relation here. We assume that an
|
||||
* ancestor BitmapHeapScan node is holding AccessShareLock (or better) on
|
||||
* the heap relation throughout the execution of the plan tree.
|
||||
*/
|
||||
|
||||
indexstate->ss.ss_currentRelation = NULL;
|
||||
indexstate->ss.ss_currentScanDesc = NULL;
|
||||
|
||||
/*
|
||||
* Miscellaneous initialization
|
||||
*
|
||||
@ -242,15 +251,6 @@ ExecInitBitmapIndexScan(BitmapIndexScan *node, EState *estate, int eflags)
|
||||
* sub-parts corresponding to runtime keys (see below).
|
||||
*/
|
||||
|
||||
/*
|
||||
* We do not open or lock the base relation here. We assume that an
|
||||
* ancestor BitmapHeapScan node is holding AccessShareLock (or better) on
|
||||
* the heap relation throughout the execution of the plan tree.
|
||||
*/
|
||||
|
||||
indexstate->ss.ss_currentRelation = NULL;
|
||||
indexstate->ss.ss_currentScanDesc = NULL;
|
||||
|
||||
/*
|
||||
* If we are just doing EXPLAIN (ie, aren't going to run the plan), stop
|
||||
* here. This allows an index-advisor plugin to EXPLAIN a plan containing
|
||||
|
Reference in New Issue
Block a user