@@ -780,7 +780,7 @@ template <typename TNodeSet> std::array<std::shared_ptr<IBaseOptimizerNode>, 2>
780
780
781
781
std::shared_ptr<TJoinOptimizerNodeInternal> tree;
782
782
auto shuffleLeftSideBestJoin = PickBestJoin (left, right, edge, true , false , maybeCardHint, maybeAlgoHint);
783
- if (reversedMapJoinStatistics.Cost < shuffleLeftSideBestJoin.Stats .Cost ) {
783
+ if (reversedMapJoinStatistics.Cost <= shuffleLeftSideBestJoin.Stats .Cost ) {
784
784
tree = MakeJoinInternal (std::move (reversedMapJoinStatistics), right, left, edge.RightJoinKeys , edge.LeftJoinKeys , edge.JoinKind , EJoinAlgoType::MapJoin, edge.RightAny , edge.LeftAny , right->Stats .LogicalOrderings );
785
785
tree->Stats .LogicalOrderings .InduceNewOrderings (edge.FDs | left->Stats .LogicalOrderings .GetFDs ());
786
786
} else {
@@ -824,7 +824,7 @@ template <typename TNodeSet> std::array<std::shared_ptr<IBaseOptimizerNode>, 2>
824
824
825
825
std::shared_ptr<TJoinOptimizerNodeInternal> tree;
826
826
auto shuffleRightSideBestJoin = PickBestJoin (left, right, edge, false , true , maybeCardHint, maybeAlgoHint);
827
- if (mapJoinStatistics.Cost < shuffleRightSideBestJoin.Stats .Cost ) {
827
+ if (mapJoinStatistics.Cost <= shuffleRightSideBestJoin.Stats .Cost ) {
828
828
tree = MakeJoinInternal (std::move (mapJoinStatistics), left, right, edge.LeftJoinKeys , edge.RightJoinKeys , edge.JoinKind , EJoinAlgoType::MapJoin, edge.LeftAny , edge.RightAny , left->Stats .LogicalOrderings );
829
829
tree->Stats .LogicalOrderings .InduceNewOrderings (edge.FDs | left->Stats .LogicalOrderings .GetFDs ());
830
830
} else {
0 commit comments