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

Function ExecIndexOnlyMarkPos

src/backend/executor/nodeIndexonlyscan.c:418–449  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

416 * ----------------------------------------------------------------
417 */
418void
419ExecIndexOnlyMarkPos(IndexOnlyScanState *node)
420{
421 EState *estate = node->ss.ps.state;
422 EPQState *epqstate = estate->es_epq_active;
423
424 if (epqstate != NULL)
425 {
426 /*
427 * We are inside an EvalPlanQual recheck. If a test tuple exists for
428 * this relation, then we shouldn't access the index at all. We would
429 * instead need to save, and later restore, the state of the
430 * relsubs_done flag, so that re-fetching the test tuple is possible.
431 * However, given the assumption that no caller sets a mark at the
432 * start of the scan, we can only get here with relsubs_done[i]
433 * already set, and so no state need be saved.
434 */
435 Index scanrelid = ((Scan *) node->ss.ps.plan)->scanrelid;
436
437 Assert(scanrelid > 0);
438 if (epqstate->relsubs_slot[scanrelid - 1] != NULL ||
439 epqstate->relsubs_rowmark[scanrelid - 1] != NULL)
440 {
441 /* Verify the claim above */
442 if (!epqstate->relsubs_done[scanrelid - 1])
443 elog(ERROR, "unexpected ExecIndexOnlyMarkPos call in EPQ recheck");
444 return;
445 }
446 }
447
448 index_markpos(node->ioss_ScanDesc);
449}
450
451/* ----------------------------------------------------------------
452 * ExecIndexOnlyRestrPos

Callers 1

ExecMarkPosFunction · 0.85

Calls 1

index_markposFunction · 0.85

Tested by

no test coverage detected