MCPcopy Create free account
hub / github.com/apache/cloudberry / ExecIndexMarkPos

Function ExecIndexMarkPos

src/backend/executor/nodeIndexscan.c:837–868  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecIndexMarkPos * * Note: we assume that no caller attempts to set a mark before having read * at least one tuple. Otherwise, iss_ScanDesc might still be NULL. * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

835 * ----------------------------------------------------------------
836 */
837void
838ExecIndexMarkPos(IndexScanState *node)
839{
840 EState *estate = node->ss.ps.state;
841 EPQState *epqstate = estate->es_epq_active;
842
843 if (epqstate != NULL)
844 {
845 /*
846 * We are inside an EvalPlanQual recheck. If a test tuple exists for
847 * this relation, then we shouldn't access the index at all. We would
848 * instead need to save, and later restore, the state of the
849 * relsubs_done flag, so that re-fetching the test tuple is possible.
850 * However, given the assumption that no caller sets a mark at the
851 * start of the scan, we can only get here with relsubs_done[i]
852 * already set, and so no state need be saved.
853 */
854 Index scanrelid = ((Scan *) node->ss.ps.plan)->scanrelid;
855
856 Assert(scanrelid > 0);
857 if (epqstate->relsubs_slot[scanrelid - 1] != NULL ||
858 epqstate->relsubs_rowmark[scanrelid - 1] != NULL)
859 {
860 /* Verify the claim above */
861 if (!epqstate->relsubs_done[scanrelid - 1])
862 elog(ERROR, "unexpected ExecIndexMarkPos call in EPQ recheck");
863 return;
864 }
865 }
866
867 index_markpos(node->iss_ScanDesc);
868}
869
870/* ----------------------------------------------------------------
871 * ExecIndexRestrPos

Callers 1

ExecMarkPosFunction · 0.85

Calls 1

index_markposFunction · 0.85

Tested by

no test coverage detected