Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit 4ca8930

Browse files
committed
Temp disable reorder for hash join
1 parent 92a1584 commit 4ca8930

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/planner/plan/plan_subquery.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ template<std::invocable<LogicalPlan&, LogicalPlan&, LogicalPlan&> AppendJoinFunc
105105
std::invocable<LogicalPlan&, LogicalPlan&> EstimateJoinCostFunc>
106106
static void planRegularMatchJoinOrder(LogicalPlan& leftPlan, LogicalPlan& rightPlan,
107107
const AppendJoinFunc& appendJoinFunc, const EstimateJoinCostFunc& estimateJoinCostFunc) {
108-
if (estimateJoinCostFunc(leftPlan, rightPlan) < estimateJoinCostFunc(rightPlan, leftPlan)) {
108+
if (estimateJoinCostFunc(leftPlan, rightPlan) <= estimateJoinCostFunc(rightPlan, leftPlan)) {
109109
appendJoinFunc(leftPlan, rightPlan, leftPlan);
110110
} else {
111111
appendJoinFunc(rightPlan, leftPlan, leftPlan);
@@ -157,15 +157,17 @@ void Planner::planRegularMatch(const QueryGraphCollection& queryGraphCollection,
157157
if (leftPlan.hasUpdate()) {
158158
appendHashJoin(joinNodeIDs, JoinType::INNER, *rightPlan, leftPlan, leftPlan);
159159
} else {
160-
planRegularMatchJoinOrder(
161-
leftPlan, *rightPlan,
162-
[this, &joinNodeIDs](LogicalPlan& leftPlan, LogicalPlan& rightPlan,
163-
LogicalPlan& resultPlan) {
164-
appendHashJoin(joinNodeIDs, JoinType::INNER, leftPlan, rightPlan, resultPlan);
165-
},
166-
[&joinNodeIDs](LogicalPlan& leftPlan, LogicalPlan& rightPlan) {
167-
return CostModel::computeHashJoinCost(joinNodeIDs, leftPlan, rightPlan);
168-
});
160+
// planRegularMatchJoinOrder(
161+
// leftPlan, *rightPlan,
162+
// [this, &joinNodeIDs](LogicalPlan& leftPlan, LogicalPlan& rightPlan,
163+
// LogicalPlan& resultPlan) {
164+
// appendHashJoin(joinNodeIDs, JoinType::INNER, leftPlan, rightPlan,
165+
// resultPlan);
166+
// },
167+
// [&joinNodeIDs](LogicalPlan& leftPlan, LogicalPlan& rightPlan) {
168+
// return CostModel::computeHashJoinCost(joinNodeIDs, leftPlan, rightPlan);
169+
// });
170+
appendHashJoin(joinNodeIDs, JoinType::INNER, leftPlan, *rightPlan, leftPlan);
169171
}
170172
}
171173
for (auto& predicate : predicatesToPullUp) {

0 commit comments

Comments
 (0)