diff --git a/src/engine/QueryPlanner.cpp b/src/engine/QueryPlanner.cpp index 00e55f5a99..96947a9f9d 100644 --- a/src/engine/QueryPlanner.cpp +++ b/src/engine/QueryPlanner.cpp @@ -2477,9 +2477,7 @@ void QueryPlanner::GraphPatternPlanner::visitPathSearch( if (pathQuery.childGraphPattern_.has_value()) { candidatesIn = planner_.optimize(&pathQuery.childGraphPattern_.value()); } else { - auto neutralElement = makeExecutionTree(qec_); - candidatesIn = { - makeSubtreePlan(qec_, std::move(neutralElement), config)}; + candidatesIn = {makeSubtreePlan(qec_)}; } std::vector candidatesOut; @@ -2502,11 +2500,7 @@ void QueryPlanner::GraphPatternPlanner::visitSpatialSearch( if (spatialQuery.childGraphPattern_.has_value()) { candidatesIn = planner_.optimize(&spatialQuery.childGraphPattern_.value()); } else { - auto neutralElementLeft = makeExecutionTree(qec_); - auto neutralElementRight = makeExecutionTree(qec_); - candidatesIn = {makeSubtreePlan( - qec_, std::make_shared(config), - std::move(neutralElementLeft), std::move(neutralElementRight))}; + candidatesIn = {makeSubtreePlan(qec_)}; } std::vector candidatesOut; @@ -2529,7 +2523,7 @@ void QueryPlanner::GraphPatternPlanner::visitSpatialSearch( candidatesOut.push_back(std::move(plan)); }; - if (!spatialQuery.childGraphPattern_.has_value()) { + if (spatialQuery.childGraphPattern_.has_value()) { // The version using the child graph pattern addCandidateSpatialJoin(false); } else {