zstan commented on code in PR #13389:
URL: https://github.com/apache/ignite/pull/13389#discussion_r3853694880


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rel/IgniteNestedLoopJoin.java:
##########
@@ -88,12 +88,16 @@ public IgniteNestedLoopJoin(RelInput input) {
         if (Double.isInfinite(rightCnt))
             return costFactory.makeInfiniteCost();
 
-        double rows = leftCnt * rightCnt;
-
         double rightSize = rightCnt * getRight().getRowType().getFieldCount() 
* IgniteCost.AVERAGE_FIELD_SIZE;
 
-        return costFactory.makeCost(rows,
-            rows * (IgniteCost.ROW_COMPARISON_COST + 
IgniteCost.ROW_PASS_THROUGH_COST), 0, rightSize, 0);
+        double rowCnt = mq.getRowCount(this);
+
+        RelOptCost cost = costFactory.makeCost(rowCnt,

Review Comment:
   All such playing with coeffs is some kind of hack and i agree that 
multiplying complexity looks strange but all these hacks need to be eliminated 
when we will implement a real statistics for calcite now - it\`s just a kind of 
assumptions. The main goal of this fix - is to store test plans and 
expectations as more as possible. If you want to play with it - try to comment 
multiplication and run PlanSplitterTest tests for example.



-- 
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]

Reply via email to