diff options
author | Andres Freund <andres@anarazel.de> | 2019-03-01 10:37:57 -0800 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2019-03-01 10:37:57 -0800 |
commit | ad0bda5d24ea2bcc72b5e50020e3c79bab10836b (patch) | |
tree | 9cf0810b842e4de24460fa8e20b21957a9e8ad01 /src/backend/executor/nodeIndexscan.c | |
parent | 6cbdbd9e8d8f2986fde44f2431ed8d0c8fce7f5d (diff) | |
download | postgresql-ad0bda5d24ea2bcc72b5e50020e3c79bab10836b.tar.gz postgresql-ad0bda5d24ea2bcc72b5e50020e3c79bab10836b.zip |
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/backend/executor/nodeIndexscan.c')
-rw-r--r-- | src/backend/executor/nodeIndexscan.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c index 8b294378936..337b561c241 100644 --- a/src/backend/executor/nodeIndexscan.c +++ b/src/backend/executor/nodeIndexscan.c @@ -850,7 +850,7 @@ ExecIndexMarkPos(IndexScanState *node) { EState *estate = node->ss.ps.state; - if (estate->es_epqTuple != NULL) + if (estate->es_epqTupleSlot != NULL) { /* * We are inside an EvalPlanQual recheck. If a test tuple exists for @@ -864,7 +864,7 @@ ExecIndexMarkPos(IndexScanState *node) Index scanrelid = ((Scan *) node->ss.ps.plan)->scanrelid; Assert(scanrelid > 0); - if (estate->es_epqTupleSet[scanrelid - 1]) + if (estate->es_epqTupleSlot[scanrelid - 1] != NULL) { /* Verify the claim above */ if (!estate->es_epqScanDone[scanrelid - 1]) @@ -885,13 +885,13 @@ ExecIndexRestrPos(IndexScanState *node) { EState *estate = node->ss.ps.state; - if (estate->es_epqTuple != NULL) + if (estate->es_epqTupleSlot != NULL) { /* See comments in ExecIndexMarkPos */ Index scanrelid = ((Scan *) node->ss.ps.plan)->scanrelid; Assert(scanrelid > 0); - if (estate->es_epqTupleSet[scanrelid - 1]) + if (estate->es_epqTupleSlot[scanrelid - 1] != NULL) { /* Verify the claim above */ if (!estate->es_epqScanDone[scanrelid - 1]) |