summaryrefslogtreecommitdiff
path: root/src/include/nodes
diff options
context:
space:
mode:
authorAndres Freund2019-03-01 18:37:57 +0000
committerAndres Freund2019-03-01 18:37:57 +0000
commitad0bda5d24ea2bcc72b5e50020e3c79bab10836b (patch)
tree9cf0810b842e4de24460fa8e20b21957a9e8ad01 /src/include/nodes
parent6cbdbd9e8d8f2986fde44f2431ed8d0c8fce7f5d (diff)
Store tuples for EvalPlanQual in slots, rather than as HeapTuples.
For the upcoming pluggable table access methods it's quite inconvenient to store tuples as HeapTuples, as that'd require converting tuples from a their native format into HeapTuples. Instead use slots to manage epq tuples. To fit into that scheme, change the foreign data wrapper callback RefetchForeignRow, to store the tuple in a slot. Insist on using the caller provided slot, so it conveniently can be stored in the corresponding EPQ slot. As there is no in core user of RefetchForeignRow, that change was done blindly, but we plan to test that soon. To avoid duplicating that work for row locks, move row locks to just directly use the EPQ slots - it previously temporarily stored tuples in LockRowsState.lr_curtuples, but that doesn't seem beneficial, given we'd possibly end up with a significant number of additional slots. The behaviour of es_epqTupleSet[rti -1] is now checked by es_epqTupleSlot[rti -1] != NULL, as that is distinguishable from a slot containing an empty tuple. Author: Andres Freund, Haribabu Kommi, Ashutosh Bapat Discussion: https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.de
Diffstat (limited to 'src/include/nodes')
-rw-r--r--src/include/nodes/execnodes.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 09f8217c800..996d872c562 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -562,15 +562,15 @@ typedef struct EState
/*
* These fields are for re-evaluating plan quals when an updated tuple is
- * substituted in READ COMMITTED mode. es_epqTuple[] contains tuples that
- * scan plan nodes should return instead of whatever they'd normally
- * return, or NULL if nothing to return; es_epqTupleSet[] is true if a
- * particular array entry is valid; and es_epqScanDone[] is state to
- * remember if the tuple has been returned already. Arrays are of size
- * es_range_table_size and are indexed by scan node scanrelid - 1.
+ * substituted in READ COMMITTED mode. es_epqTupleSlot[] contains test
+ * tuples that scan plan nodes should return instead of whatever they'd
+ * normally return, or an empty slot if there is nothing to return; if
+ * es_epqTupleSlot[] is not NULL if a particular array entry is valid; and
+ * es_epqScanDone[] is state to remember if the tuple has been returned
+ * already. Arrays are of size es_range_table_size and are indexed by
+ * scan node scanrelid - 1.
*/
- HeapTuple *es_epqTuple; /* array of EPQ substitute tuples */
- bool *es_epqTupleSet; /* true if EPQ tuple is provided */
+ TupleTableSlot **es_epqTupleSlot; /* array of EPQ substitute tuples */
bool *es_epqScanDone; /* true if EPQ tuple has been fetched */
bool es_use_parallel_mode; /* can we use parallel workers? */
@@ -2257,8 +2257,6 @@ typedef struct LockRowsState
PlanState ps; /* its first field is NodeTag */
List *lr_arowMarks; /* List of ExecAuxRowMarks */
EPQState lr_epqstate; /* for evaluating EvalPlanQual rechecks */
- HeapTuple *lr_curtuples; /* locked tuples (one entry per RT entry) */
- int lr_ntables; /* length of lr_curtuples[] array */
} LockRowsState;
/* ----------------