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

Function ExecReScanIndexScan

src/backend/executor/nodeIndexscan.c:554–594  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecReScanIndexScan(node) * * Recalculates the values of any scan keys whose value depends on * information known at runtime, then rescans the indexed relation. * * Updating the scan key was formerly done separately in * ExecUpdateIndexScanKeys. Integrating it into ReScan makes * rescans of indices and relations/gener

Source from the content-addressed store, hash-verified

552 * ----------------------------------------------------------------
553 */
554void
555ExecReScanIndexScan(IndexScanState *node)
556{
557 /*
558 * If we are doing runtime key calculations (ie, any of the index key
559 * values weren't simple Consts), compute the new key values. But first,
560 * reset the context so we don't leak memory as each outer tuple is
561 * scanned. Note this assumes that we will recalculate *all* runtime keys
562 * on each call.
563 */
564 if (node->iss_NumRuntimeKeys != 0)
565 {
566 ExprContext *econtext = node->iss_RuntimeContext;
567
568 ResetExprContext(econtext);
569 ExecIndexEvalRuntimeKeys(econtext,
570 node->iss_RuntimeKeys,
571 node->iss_NumRuntimeKeys);
572 }
573 node->iss_RuntimeKeysReady = true;
574
575 /* flush the reorder queue */
576 if (node->iss_ReorderQueue)
577 {
578 HeapTuple tuple;
579 while (!pairingheap_is_empty(node->iss_ReorderQueue))
580 {
581 tuple = reorderqueue_pop(node);
582 heap_freetuple(tuple);
583 }
584 }
585
586 /* reset index scan */
587 if (node->iss_ScanDesc)
588 index_rescan(node->iss_ScanDesc,
589 node->iss_ScanKeys, node->iss_NumScanKeys,
590 node->iss_OrderByKeys, node->iss_NumOrderByKeys);
591 node->iss_ReachedEnd = false;
592
593 ExecScanReScan(&node->ss);
594}
595
596
597/*

Callers 2

ExecReScanFunction · 0.85
beginCurrentIndexScanFunction · 0.85

Calls 5

ExecIndexEvalRuntimeKeysFunction · 0.85
reorderqueue_popFunction · 0.85
heap_freetupleFunction · 0.85
index_rescanFunction · 0.85
ExecScanReScanFunction · 0.85

Tested by

no test coverage detected