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

Function ExecInitTidScan

src/backend/executor/nodeTidscan.c:499–560  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecInitTidScan * * Initializes the tid scan's state information, creates * scan keys, and opens the base and tid relations. * * Parameters: * node: TidScan node produced by the planner. * estate: the execution state initialized in InitPlan. * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

497 * ----------------------------------------------------------------
498 */
499TidScanState *
500ExecInitTidScan(TidScan *node, EState *estate, int eflags)
501{
502 TidScanState *tidstate;
503 Relation currentRelation;
504
505 /*
506 * create state structure
507 */
508 tidstate = makeNode(TidScanState);
509 tidstate->ss.ps.plan = (Plan *) node;
510 tidstate->ss.ps.state = estate;
511 tidstate->ss.ps.ExecProcNode = ExecTidScan;
512
513 /*
514 * Miscellaneous initialization
515 *
516 * create expression context for node
517 */
518 ExecAssignExprContext(estate, &tidstate->ss.ps);
519
520 /*
521 * mark tid list as not computed yet
522 */
523 tidstate->tss_TidList = NULL;
524 tidstate->tss_NumTids = 0;
525 tidstate->tss_TidPtr = -1;
526
527 /*
528 * open the scan relation
529 */
530 currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid, eflags);
531
532 tidstate->ss.ss_currentRelation = currentRelation;
533 tidstate->ss.ss_currentScanDesc = NULL; /* no heap scan here */
534
535 /*
536 * get the scan type from the relation descriptor.
537 */
538 ExecInitScanTupleSlot(estate, &tidstate->ss,
539 RelationGetDescr(currentRelation),
540 table_slot_callbacks(currentRelation));
541
542 /*
543 * Initialize result type and projection.
544 */
545 ExecInitResultTypeTL(&tidstate->ss.ps);
546 ExecAssignScanProjectionInfo(&tidstate->ss);
547
548 /*
549 * initialize child expressions
550 */
551 tidstate->ss.ps.qual =
552 ExecInitQual(node->scan.plan.qual, (PlanState *) tidstate);
553
554 TidExprListCreate(tidstate);
555
556 /*

Callers 1

ExecInitNodeFunction · 0.85

Calls 8

ExecAssignExprContextFunction · 0.85
ExecOpenScanRelationFunction · 0.85
ExecInitScanTupleSlotFunction · 0.85
table_slot_callbacksFunction · 0.85
ExecInitResultTypeTLFunction · 0.85
ExecInitQualFunction · 0.85
TidExprListCreateFunction · 0.70

Tested by

no test coverage detected