| 674 | // |
| 675 | |
| 676 | RecordSource* Optimizer::compile(RseNode* subRse, BoolExprNodeStack* parentStack) |
| 677 | { |
| 678 | // dimitr: it makes no sense to optimize sub-RSE for first rows |
| 679 | // if we're going to sort/aggregate the resultset afterwards |
| 680 | const bool subFirstRows = firstRows && !rse->rse_sorted && !rse->rse_aggregate; |
| 681 | |
| 682 | Optimizer subOpt(tdbb, csb, subRse, subFirstRows); |
| 683 | const auto rsb = subOpt.compile(parentStack); |
| 684 | |
| 685 | if (parentStack && subOpt.isInnerJoin()) |
| 686 | { |
| 687 | // If any parent conjunct was utilized, update our copy of its flags. |
| 688 | // Currently used for inner joins only, although could also be applied |
| 689 | // to conjuncts utilized for outer streams of outer joins. |
| 690 | |
| 691 | for (auto subIter = subOpt.getParentConjuncts(); subIter.hasData(); ++subIter) |
| 692 | { |
| 693 | for (auto selfIter = getConjuncts(); selfIter.hasData(); ++selfIter) |
| 694 | { |
| 695 | if (*selfIter == *subIter) |
| 696 | { |
| 697 | selfIter |= subIter.getFlags(); |
| 698 | break; |
| 699 | } |
| 700 | } |
| 701 | } |
| 702 | } |
| 703 | |
| 704 | return rsb; |
| 705 | } |
| 706 | |
| 707 | RecordSource* Optimizer::compile(BoolExprNodeStack* parentStack) |
| 708 | { |
nothing calls this directly
no test coverage detected