Skip to content

Commit

Permalink
A small fix.
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
  • Loading branch information
joka921 committed Jan 9, 2025
1 parent 740d186 commit 2050af8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/engine/QueryPlanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,8 @@ size_t QueryPlanner::countSubgraphs(
dummyPlansForFilter.push_back(
makeSubtreePlan<Values>(_qec, std::move(values)));
}

const size_t numPlansWithoutFilters = graph.size();
for (const auto& filterPlan : dummyPlansForFilter) {
graph.push_back(&filterPlan);
}
Expand All @@ -1378,7 +1380,11 @@ size_t QueryPlanner::countSubgraphs(
for (size_t i = 0; i < graph.size(); ++i) {
countConnectedSubgraphs::Node v{0};
for (size_t k = 0; k < graph.size(); ++k) {
// Don't connect nodes to themselves, don't connect filters with other
// filters, otherwise connect `i` and `k` if they have at least one
// variable in common.
if ((k != i) &&
(k < numPlansWithoutFilters || i < numPlansWithoutFilters) &&
!QueryPlanner::getJoinColumns(*graph.at(k), *graph.at(i)).empty()) {
v.neighbors_ |= (1ULL << k);
}
Expand Down

0 comments on commit 2050af8

Please sign in to comment.