This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0-beta
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 8ec410794a4d16f40320942a141d641031d498e4
Author: morrySnow <101034200+morrys...@users.noreply.github.com>
AuthorDate: Fri Jun 9 19:16:39 2023 +0800

    [opt](Nereids) remove running in OptimizeGroup to avoid recompute on it 
parent (#20608)
    
    we have some prunning path logical in cascades framework. However it do not 
work as we expected. if we do prunning on one Group, then maybe we need to do 
thousands of times optimization on its parent without any success result. This 
PR remove these prunning provisionally. We will add prunning back when we 
re-design it.
---
 .../nereids/jobs/cascades/OptimizeGroupJob.java    |  3 +-
 .../nereids_tpcds_shape_sf100_p0/shape/query33.out | 44 +++++++++++-----------
 2 files changed, 23 insertions(+), 24 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/OptimizeGroupJob.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/OptimizeGroupJob.java
index 2bda4ce569..88200d227c 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/OptimizeGroupJob.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/OptimizeGroupJob.java
@@ -42,8 +42,7 @@ public class OptimizeGroupJob extends Job {
     @Override
     public void execute() {
         COUNTER_TRACER.log(CounterEvent.of(Memo.getStateId(), 
CounterType.JOB_EXECUTION, group, null, null));
-        if (group.getCostLowerBound() > context.getCostUpperBound()
-                || 
group.getLowestCostPlan(context.getRequiredProperties()).isPresent()) {
+        if 
(group.getLowestCostPlan(context.getRequiredProperties()).isPresent()) {
             return;
         }
         if (!group.isExplored()) {
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query33.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query33.out
index cd1a4d6dbb..559cbef994 100644
--- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query33.out
+++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query33.out
@@ -8,32 +8,32 @@ PhysicalTopN
 ----------hashAgg[LOCAL]
 ------------PhysicalUnion
 --------------PhysicalProject
-----------------hashAgg[GLOBAL]
-------------------PhysicalDistribute
---------------------hashAgg[LOCAL]
-----------------------PhysicalProject
-------------------------hashJoin[INNER_JOIN](store_sales.ss_item_sk = 
item.i_item_sk)
---------------------------PhysicalProject
-----------------------------hashJoin[INNER_JOIN](store_sales.ss_addr_sk = 
customer_address.ca_address_sk)
-------------------------------hashJoin[INNER_JOIN](store_sales.ss_sold_date_sk 
= date_dim.d_date_sk)
---------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[store_sales]
+----------------hashJoin[LEFT_SEMI_JOIN](item.i_manufact_id = 
item.i_manufact_id)
+------------------hashAgg[GLOBAL]
+--------------------PhysicalDistribute
+----------------------hashAgg[LOCAL]
+------------------------PhysicalProject
+--------------------------hashJoin[INNER_JOIN](store_sales.ss_item_sk = 
item.i_item_sk)
+----------------------------PhysicalProject
+------------------------------hashJoin[INNER_JOIN](store_sales.ss_addr_sk = 
customer_address.ca_address_sk)
+--------------------------------hashJoin[INNER_JOIN](store_sales.ss_sold_date_sk
 = date_dim.d_date_sk)
+----------------------------------PhysicalProject
+------------------------------------PhysicalOlapScan[store_sales]
+----------------------------------PhysicalDistribute
+------------------------------------PhysicalProject
+--------------------------------------filter((date_dim.d_moy = 
1)(date_dim.d_year = 2002))
+----------------------------------------PhysicalOlapScan[date_dim]
 --------------------------------PhysicalDistribute
 ----------------------------------PhysicalProject
-------------------------------------filter((date_dim.d_moy = 
1)(date_dim.d_year = 2002))
---------------------------------------PhysicalOlapScan[date_dim]
-------------------------------PhysicalDistribute
---------------------------------PhysicalProject
-----------------------------------filter((customer_address.ca_gmt_offset = 
-5.00))
-------------------------------------PhysicalOlapScan[customer_address]
---------------------------PhysicalDistribute
-----------------------------hashJoin[LEFT_SEMI_JOIN](item.i_manufact_id = 
item.i_manufact_id)
+------------------------------------filter((customer_address.ca_gmt_offset = 
-5.00))
+--------------------------------------PhysicalOlapScan[customer_address]
+----------------------------PhysicalDistribute
 ------------------------------PhysicalProject
 --------------------------------PhysicalOlapScan[item]
-------------------------------PhysicalDistribute
---------------------------------PhysicalProject
-----------------------------------filter((item.i_category = 'Home'))
-------------------------------------PhysicalOlapScan[item]
+------------------PhysicalDistribute
+--------------------PhysicalProject
+----------------------filter((item.i_category = 'Home'))
+------------------------PhysicalOlapScan[item]
 --------------PhysicalProject
 ----------------hashJoin[LEFT_SEMI_JOIN](item.i_manufact_id = 
item.i_manufact_id)
 ------------------hashAgg[GLOBAL]


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to