39 if (
const Scan* scan =
dynamic_cast<Scan*
>(node.get())) {
41 if (scan->getTupleId() == 0 &&
rel.getArity() > 0) {
42 if (!isA<Project>(&scan->getOperation())) {
44 return mk<ParallelScan>(scan->getRelation(), scan->getTupleId(),
48 }
else if (
const Choice* choice =
dynamic_cast<Choice*
>(node.get())) {
49 if (choice->getTupleId() == 0) {
51 return mk<ParallelChoice>(choice->getRelation(), choice->getTupleId(),
53 choice->getProfileText());
56 if (indexScan->getTupleId() == 0) {
59 return mk<ParallelIndexScan>(indexScan->getRelation(), indexScan->getTupleId(),
60 std::move(queryPattern),
souffle::clone(&indexScan->getOperation()),
61 indexScan->getProfileText());
64 if (indexChoice->getTupleId() == 0) {
67 return mk<ParallelIndexChoice>(indexChoice->getRelation(), indexChoice->getTupleId(),
68 souffle::clone(&indexChoice->getCondition()), std::move(queryPattern),
69 souffle::clone(&indexChoice->getOperation()), indexChoice->getProfileText());
73 if (aggregate->getTupleId() == 0 && !
rel.isNullary()) {
75 return mk<ParallelAggregate>(
Own<Operation>(aggregate->getOperation().clone()),
76 aggregate->getFunction(), aggregate->getRelation(),
78 Own<Condition>(aggregate->getCondition().clone()), aggregate->getTupleId());
82 if (indexAggregate->getTupleId() == 0 && !
rel.isNullary()) {
85 return mk<ParallelIndexAggregate>(
Own<Operation>(indexAggregate->getOperation().clone()),
86 indexAggregate->getFunction(), indexAggregate->getRelation(),
88 Own<Condition>(indexAggregate->getCondition().clone()), std::move(queryPattern),
89 indexAggregate->getTupleId());