XieJiann commented on code in PR #26086:
URL: https://github.com/apache/doris/pull/26086#discussion_r1388901111
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/join/InnerJoinLAsscom.java:
##########
@@ -85,11 +91,22 @@ public Rule build() {
}).toRule(RuleType.LOGICAL_INNER_JOIN_LASSCOM);
}
+ /**
+ * trigger rule condition
+ */
public static boolean checkReorder(LogicalJoin<? extends Plan, GroupPlan>
topJoin,
- LogicalJoin<GroupPlan, GroupPlan> bottomJoin) {
- return !bottomJoin.getJoinReorderContext().hasCommuteZigZag()
- && !topJoin.getJoinReorderContext().hasLAsscom()
- && (!bottomJoin.isMarkJoin() && !topJoin.isMarkJoin());
+ LogicalJoin<GroupPlan, GroupPlan> bottomJoin, boolean leftZigZag) {
+ if (leftZigZag) {
+ double bRows =
bottomJoin.right().getGroup().getStatistics().getRowCount();
+ double cRows =
topJoin.right().getGroup().getStatistics().getRowCount();
+ return bRows < cRows &&
!bottomJoin.getJoinReorderContext().hasCommuteZigZag()
+ && !topJoin.getJoinReorderContext().hasLAsscom()
+ && (!bottomJoin.isMarkJoin() && !topJoin.isMarkJoin());
Review Comment:
Add more comments to explain it. It may seem quite challenging to comprehend
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]