---------------------------------------------------------------- * ExecInitNestLoop * ---------------------------------------------------------------- */
| 404 | * ---------------------------------------------------------------- |
| 405 | */ |
| 406 | NestLoopState * |
| 407 | ExecInitNestLoop(NestLoop *node, EState *estate, int eflags) |
| 408 | { |
| 409 | NestLoopState *nlstate; |
| 410 | |
| 411 | /* check for unsupported flags */ |
| 412 | Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK))); |
| 413 | |
| 414 | NL1_printf("ExecInitNestLoop: %s\n", |
| 415 | "initializing node"); |
| 416 | |
| 417 | /* |
| 418 | * create state structure |
| 419 | */ |
| 420 | nlstate = makeNode(NestLoopState); |
| 421 | nlstate->js.ps.plan = (Plan *) node; |
| 422 | nlstate->js.ps.state = estate; |
| 423 | nlstate->js.ps.ExecProcNode = ExecNestLoop; |
| 424 | |
| 425 | nlstate->shared_outer = node->shared_outer; |
| 426 | |
| 427 | nlstate->prefetch_inner = node->join.prefetch_inner; |
| 428 | nlstate->prefetch_joinqual = node->join.prefetch_joinqual; |
| 429 | nlstate->prefetch_qual = node->join.prefetch_qual; |
| 430 | |
| 431 | if (Test_print_prefetch_joinqual && nlstate->prefetch_joinqual) |
| 432 | elog(NOTICE, |
| 433 | "prefetch join qual in slice %d of plannode %d", |
| 434 | currentSliceId, ((Plan *) node)->plan_node_id); |
| 435 | |
| 436 | /* |
| 437 | * reuse GUC Test_print_prefetch_joinqual to output debug information for |
| 438 | * prefetching non join qual |
| 439 | */ |
| 440 | if (Test_print_prefetch_joinqual && nlstate->prefetch_qual) |
| 441 | elog(NOTICE, |
| 442 | "prefetch non join qual in slice %d of plannode %d", |
| 443 | currentSliceId, ((Plan *) node)->plan_node_id); |
| 444 | |
| 445 | /*CDB-OLAP*/ |
| 446 | nlstate->reset_inner = false; |
| 447 | nlstate->require_inner_reset = !node->singleton_outer; |
| 448 | |
| 449 | /* |
| 450 | * Miscellaneous initialization |
| 451 | * |
| 452 | * create expression context for node |
| 453 | */ |
| 454 | ExecAssignExprContext(estate, &nlstate->js.ps); |
| 455 | |
| 456 | /* |
| 457 | * initialize child nodes |
| 458 | * |
| 459 | * If we have no parameters to pass into the inner rel from the outer, |
| 460 | * tell the inner child that cheap rescans would be good. If we do have |
| 461 | * such parameters, then there is no point in REWIND support at all in the |
| 462 | * inner child, because it will always be rescanned with fresh parameter |
| 463 | * values. |
no test coverage detected