Skip to content

Commit

Permalink
avoid checking spatial join twice
Browse files Browse the repository at this point in the history
  • Loading branch information
ullingerc committed Nov 24, 2024
1 parent 8fabe62 commit fe3ff24
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/engine/QueryPlanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1817,6 +1817,13 @@ std::vector<QueryPlanner::SubtreePlan> QueryPlanner::createJoinCandidates(
return candidates;
}

// If both sides are spatial joins, return immediately to prevent a regular
// join on the variables, which would lead to the spatial join never having
// children.
if (checkSpatialJoin(a, b) == std::pair<bool, bool>{true, true}) {
return candidates;
}

// if one of the inputs is the spatial join and the other input is compatible
// with the SpatialJoin, add it as a child to the spatialJoin. As unbound
// SpatialJoin operations are incompatible with normal join operations, we
Expand All @@ -1828,13 +1835,6 @@ std::vector<QueryPlanner::SubtreePlan> QueryPlanner::createJoinCandidates(
return candidates;
}

// If both sides are spatial joins, return immediately to prevent a regular
// join on the variables, which would lead to the spatial join never having
// children.
if (checkSpatialJoin(a, b) == std::pair<bool, bool>{true, true}) {
return candidates;
}

if (a.type == SubtreePlan::MINUS) {
AD_THROW(
"MINUS can only appear after"
Expand Down

0 comments on commit fe3ff24

Please sign in to comment.