Skip to content

Commit

Permalink
join A+B => max(A,B)
Browse files Browse the repository at this point in the history
  • Loading branch information
englefly committed Nov 2, 2023
1 parent 00eba56 commit eb24f51
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private static Statistics estimateNestLoopJoin(Statistics leftStats, Statistics

private static Statistics estimateInnerJoin(Statistics leftStats, Statistics rightStats, Join join) {
if (hashJoinConditionContainsUnknownColumnStats(leftStats, rightStats, join)) {
double rowCount = leftStats.getRowCount() + rightStats.getRowCount();
double rowCount = Math.max(leftStats.getRowCount(), rightStats.getRowCount());
rowCount = Math.max(1, rowCount);
return new StatisticsBuilder()
.setRowCount(rowCount)
Expand Down

0 comments on commit eb24f51

Please sign in to comment.