diff --git a/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/cost/CostModel.java b/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/cost/CostModel.java index f211c4b3ecb8a7..a3ffa7f88bebbe 100644 --- a/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/cost/CostModel.java +++ b/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/cost/CostModel.java @@ -175,11 +175,7 @@ public CostEstimate visitPhysicalOlapScan(PhysicalOlapScanOperator node, Express } } - // ScanOperator use a ChunkBuffer to implement async-io, which may takes significant memory for certain - // cases - SessionVariable variables = ConnectContext.get().getSessionVariable(); - double memCost = (double) statistics.getAvgRowSize() * variables.getDegreeOfParallelism(); - return CostEstimate.of(statistics.getComputeSize(), memCost, 0); + return CostEstimate.of(statistics.getComputeSize(), 0, 0); } @Override diff --git a/fe/fe-core/src/test/java/com/starrocks/sql/plan/PlanFragmentWithCostTest.java b/fe/fe-core/src/test/java/com/starrocks/sql/plan/PlanFragmentWithCostTest.java index f0e1732adce70a..dd08aa9b2aa307 100644 --- a/fe/fe-core/src/test/java/com/starrocks/sql/plan/PlanFragmentWithCostTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/sql/plan/PlanFragmentWithCostTest.java @@ -2237,11 +2237,11 @@ public void testPlanCost() throws Exception { System.out.println(plan); assertContains(plan, "PLAN COST\n" + " CPU: 4.80001312001E11\n" + - " Memory: 320241.0"); + " Memory: 320201.0"); assertContains(getCostExplain(sql), "PLAN COST\n" + " CPU: 4.80001312001E11\n" + - " Memory: 320241.0"); + " Memory: 320201.0"); AuditEvent event = connectContext.getAuditEventBuilder().build(); Assert.assertTrue("planMemCosts should be > 1, but: " + event.planMemCosts, event.planMemCosts > 1); diff --git a/fe/fe-core/src/test/java/com/starrocks/sql/plan/ReplayFromDumpTest.java b/fe/fe-core/src/test/java/com/starrocks/sql/plan/ReplayFromDumpTest.java index 8cdf5c90a858c9..b26cce619a3465 100644 --- a/fe/fe-core/src/test/java/com/starrocks/sql/plan/ReplayFromDumpTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/sql/plan/ReplayFromDumpTest.java @@ -509,7 +509,7 @@ public void testMultiSubqueries() throws Exception { public void testCorrelatedPredicateRewrite() throws Exception { Pair replayPair = getPlanFragment(getDumpInfoFromFile("query_dump/union_with_subquery"), null, TExplainLevel.COSTS); - Assert.assertTrue(replayPair.second, replayPair.second.contains("1197:HASH JOIN\n" + + Assert.assertTrue(replayPair.second, replayPair.second.contains("1201:HASH JOIN\n" + " | join op: RIGHT OUTER JOIN (BUCKET_SHUFFLE(S))\n" + " | equal join conjunct: [3802: ref_id, BIGINT, true] = [3681: customer_id, BIGINT, true]")); }