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

Function ExecInitMergeJoin

src/backend/executor/nodeMergejoin.c:1546–1759  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecInitMergeJoin * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

1544 * ----------------------------------------------------------------
1545 */
1546MergeJoinState *
1547ExecInitMergeJoin(MergeJoin *node, EState *estate, int eflags)
1548{
1549 MergeJoinState *mergestate;
1550 int rewindflag;
1551 TupleDesc outerDesc,
1552 innerDesc;
1553 const TupleTableSlotOps *innerOps;
1554
1555 /* check for unsupported flags */
1556 Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));
1557
1558 MJ1_printf("ExecInitMergeJoin: %s\n",
1559 "initializing node");
1560
1561 /*
1562 * create state structure
1563 */
1564 mergestate = makeNode(MergeJoinState);
1565 mergestate->js.ps.plan = (Plan *) node;
1566 mergestate->js.ps.state = estate;
1567 mergestate->js.ps.ExecProcNode = ExecMergeJoin;
1568 mergestate->js.jointype = node->join.jointype;
1569 mergestate->mj_ConstFalseJoin = false;
1570
1571 /*
1572 * Miscellaneous initialization
1573 *
1574 * create expression context for node
1575 */
1576 ExecAssignExprContext(estate, &mergestate->js.ps);
1577
1578 /*
1579 * we need two additional econtexts in which we can compute the join
1580 * expressions from the left and right input tuples. The node's regular
1581 * econtext won't do because it gets reset too often.
1582 */
1583 mergestate->mj_OuterEContext = CreateExprContext(estate);
1584 mergestate->mj_InnerEContext = CreateExprContext(estate);
1585
1586
1587 mergestate->prefetch_inner = node->join.prefetch_inner;
1588 mergestate->prefetch_joinqual = node->join.prefetch_joinqual;
1589 mergestate->prefetch_qual = node->join.prefetch_qual;
1590
1591 if (Test_print_prefetch_joinqual && mergestate->prefetch_joinqual)
1592 elog(NOTICE,
1593 "prefetch join qual in slice %d of plannode %d",
1594 currentSliceId, ((Plan *) node)->plan_node_id);
1595
1596 /*
1597 * reuse GUC Test_print_prefetch_joinqual to output debug information for
1598 * prefetching non join qual
1599 */
1600 if (Test_print_prefetch_joinqual && mergestate->prefetch_qual)
1601 elog(NOTICE,
1602 "prefetch non join qual in slice %d of plannode %d",
1603 currentSliceId, ((Plan *) node)->plan_node_id);

Callers 1

ExecInitNodeFunction · 0.85

Calls 15

ExecAssignExprContextFunction · 0.85
CreateExprContextFunction · 0.85
ExecInitNodeFunction · 0.85
ExecGetResultTypeFunction · 0.85
ExecAssignProjectionInfoFunction · 0.85
ExecGetResultSlotOpsFunction · 0.85
ExecInitExtraTupleSlotFunction · 0.85
ExecInitQualFunction · 0.85
ExecInitNullTupleSlotFunction · 0.85
check_constant_qualFunction · 0.85
list_lengthFunction · 0.85

Tested by

no test coverage detected