From d91a2dd412f916a4e50569ec2710ddf9eed8b0fe Mon Sep 17 00:00:00 2001
From: minghong <englefly@gmail.com>
Date: Tue, 22 Oct 2024 09:30:46 +0800
Subject: [PATCH] fixed join order

---
 .../eager_aggregate/basic.out                 |  4 +-
 .../eager_aggregate/basic_one_side.out        |  4 +-
 .../push_down_count_through_join.out          | 40 +++++++++----------
 .../push_down_count_through_join_one_side.out | 40 +++++++++----------
 .../push_down_max_through_join.out            | 20 +++++-----
 .../push_down_min_through_join.out            | 20 +++++-----
 .../push_down_sum_through_join.out            | 20 +++++-----
 .../push_down_sum_through_join_one_side.out   | 20 +++++-----
 .../eliminate_outer_join.out                  | 40 +++++++++----------
 .../eager_aggregate/basic.groovy              |  1 +
 .../eager_aggregate/basic_one_side.groovy     |  1 +
 .../push_down_count_through_join.groovy       |  1 +
 ...sh_down_count_through_join_one_side.groovy |  1 +
 .../push_down_max_through_join.groovy         |  3 +-
 .../push_down_min_through_join.groovy         |  1 +
 .../push_down_sum_through_join.groovy         |  1 +
 ...push_down_sum_through_join_one_side.groovy |  1 +
 .../eliminate_outer_join.groovy               |  2 +-
 18 files changed, 114 insertions(+), 106 deletions(-)

diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/basic.out b/regression-test/data/nereids_rules_p0/eager_aggregate/basic.out
index 3e3986c75fc91c..ba18189efcad82 100644
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/basic.out
+++ b/regression-test/data/nereids_rules_p0/eager_aggregate/basic.out
@@ -32,8 +32,8 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------PhysicalOlapScan[shunt_log_com_dd_library]
 --------PhysicalOlapScan[com_dd_library]
+--------PhysicalOlapScan[shunt_log_com_dd_library]
 
 -- !with_hint_1 --
 PhysicalResultSink
@@ -83,8 +83,8 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------PhysicalOlapScan[shunt_log_com_dd_library]
 --------PhysicalOlapScan[com_dd_library]
+--------PhysicalOlapScan[shunt_log_com_dd_library]
 
 Hint log:
 Used:
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/basic_one_side.out b/regression-test/data/nereids_rules_p0/eager_aggregate/basic_one_side.out
index 49f1cc9617a090..aaf6afeca1e9f6 100644
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/basic_one_side.out
+++ b/regression-test/data/nereids_rules_p0/eager_aggregate/basic_one_side.out
@@ -32,8 +32,8 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------PhysicalOlapScan[shunt_log_com_dd_library_one_side]
 --------PhysicalOlapScan[com_dd_library_one_side]
+--------PhysicalOlapScan[shunt_log_com_dd_library_one_side]
 
 -- !with_hint_1 --
 PhysicalResultSink
@@ -83,8 +83,8 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------PhysicalOlapScan[shunt_log_com_dd_library_one_side]
 --------PhysicalOlapScan[com_dd_library_one_side]
+--------PhysicalOlapScan[shunt_log_com_dd_library_one_side]
 
 Hint log:
 Used:
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join.out
index 4a12c8d638a4e7..ca56c802a9bed0 100644
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join.out
+++ b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join.out
@@ -68,9 +68,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t]
 --------filter((count_t.score > 10))
 ----------PhysicalOlapScan[count_t]
+--------PhysicalOlapScan[count_t]
 
 -- !groupby_pushdown_outer_join --
 PhysicalResultSink
@@ -85,9 +85,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t]
 --------filter((count_t.score > 10))
 ----------PhysicalOlapScan[count_t]
+--------PhysicalOlapScan[count_t]
 
 -- !groupby_pushdown_having --
 PhysicalResultSink
@@ -163,9 +163,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t]
 --------filter((t1.score > 50))
 ----------PhysicalOlapScan[count_t]
+--------PhysicalOlapScan[count_t]
 
 -- !groupby_pushdown_varied_aggregates --
 PhysicalResultSink
@@ -214,10 +214,10 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((count_t.id < 100))
-----------PhysicalOlapScan[count_t]
 --------filter((count_t.score > 20) and (t1.id < 100))
 ----------PhysicalOlapScan[count_t]
+--------filter((count_t.id < 100))
+----------PhysicalOlapScan[count_t]
 
 -- !groupby_pushdown_basic --
 PhysicalResultSink
@@ -288,9 +288,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t]
 --------filter((count_t.score > 10))
 ----------PhysicalOlapScan[count_t]
+--------PhysicalOlapScan[count_t]
 
 -- !groupby_pushdown_outer_join --
 PhysicalResultSink
@@ -305,9 +305,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t]
 --------filter((count_t.score > 10))
 ----------PhysicalOlapScan[count_t]
+--------PhysicalOlapScan[count_t]
 
 -- !groupby_pushdown_having --
 PhysicalResultSink
@@ -359,9 +359,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t]
 --------filter((t1.score > 50))
 ----------PhysicalOlapScan[count_t]
+--------PhysicalOlapScan[count_t]
 
 -- !groupby_pushdown_varied_aggregates --
 PhysicalResultSink
@@ -394,10 +394,10 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((count_t.id < 100))
-----------PhysicalOlapScan[count_t]
 --------filter((count_t.score > 20) and (t1.id < 100))
 ----------PhysicalOlapScan[count_t]
+--------filter((count_t.id < 100))
+----------PhysicalOlapScan[count_t]
 
 -- !with_hint_groupby_pushdown_basic --
 PhysicalResultSink
@@ -508,9 +508,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t]
 --------filter((count_t.score > 10))
 ----------PhysicalOlapScan[count_t]
+--------PhysicalOlapScan[count_t]
 
 Hint log:
 Used:
@@ -535,9 +535,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t]
 --------filter((count_t.score > 10))
 ----------PhysicalOlapScan[count_t]
+--------PhysicalOlapScan[count_t]
 
 Hint log:
 Used:
@@ -658,9 +658,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t]
 --------filter((t1.score > 50))
 ----------PhysicalOlapScan[count_t]
+--------PhysicalOlapScan[count_t]
 
 Hint log:
 Used:
@@ -739,10 +739,10 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((count_t.id < 100))
-----------PhysicalOlapScan[count_t]
 --------filter((count_t.score > 20) and (t1.id < 100))
 ----------PhysicalOlapScan[count_t]
+--------filter((count_t.id < 100))
+----------PhysicalOlapScan[count_t]
 
 Hint log:
 Used:
@@ -858,9 +858,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t]
 --------filter((count_t.score > 10))
 ----------PhysicalOlapScan[count_t]
+--------PhysicalOlapScan[count_t]
 
 Hint log:
 Used:
@@ -885,9 +885,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t]
 --------filter((count_t.score > 10))
 ----------PhysicalOlapScan[count_t]
+--------PhysicalOlapScan[count_t]
 
 Hint log:
 Used:
@@ -969,9 +969,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t]
 --------filter((t1.score > 50))
 ----------PhysicalOlapScan[count_t]
+--------PhysicalOlapScan[count_t]
 
 Hint log:
 Used:
@@ -1024,10 +1024,10 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((count_t.id < 100))
-----------PhysicalOlapScan[count_t]
 --------filter((count_t.score > 20) and (t1.id < 100))
 ----------PhysicalOlapScan[count_t]
+--------filter((count_t.id < 100))
+----------PhysicalOlapScan[count_t]
 
 Hint log:
 Used:
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.out
index a2a716e6e6e819..49f21c8db908c2 100644
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.out
+++ b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.out
@@ -68,9 +68,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side]
 --------filter((count_t_one_side.score > 10))
 ----------PhysicalOlapScan[count_t_one_side]
+--------PhysicalOlapScan[count_t_one_side]
 
 -- !groupby_pushdown_outer_join --
 PhysicalResultSink
@@ -85,9 +85,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side]
 --------filter((count_t_one_side.score > 10))
 ----------PhysicalOlapScan[count_t_one_side]
+--------PhysicalOlapScan[count_t_one_side]
 
 -- !groupby_pushdown_having --
 PhysicalResultSink
@@ -162,9 +162,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side]
 --------filter((t1.score > 50))
 ----------PhysicalOlapScan[count_t_one_side]
+--------PhysicalOlapScan[count_t_one_side]
 
 -- !groupby_pushdown_varied_aggregates --
 PhysicalResultSink
@@ -213,10 +213,10 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((count_t_one_side.id < 100))
-----------PhysicalOlapScan[count_t_one_side]
 --------filter((count_t_one_side.score > 20) and (t1.id < 100))
 ----------PhysicalOlapScan[count_t_one_side]
+--------filter((count_t_one_side.id < 100))
+----------PhysicalOlapScan[count_t_one_side]
 
 -- !groupby_pushdown_basic --
 PhysicalResultSink
@@ -287,9 +287,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side]
 --------filter((count_t_one_side.score > 10))
 ----------PhysicalOlapScan[count_t_one_side]
+--------PhysicalOlapScan[count_t_one_side]
 
 -- !groupby_pushdown_outer_join --
 PhysicalResultSink
@@ -304,9 +304,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side]
 --------filter((count_t_one_side.score > 10))
 ----------PhysicalOlapScan[count_t_one_side]
+--------PhysicalOlapScan[count_t_one_side]
 
 -- !groupby_pushdown_having --
 PhysicalResultSink
@@ -357,9 +357,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side]
 --------filter((t1.score > 50))
 ----------PhysicalOlapScan[count_t_one_side]
+--------PhysicalOlapScan[count_t_one_side]
 
 -- !groupby_pushdown_varied_aggregates --
 PhysicalResultSink
@@ -392,10 +392,10 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((count_t_one_side.id < 100))
-----------PhysicalOlapScan[count_t_one_side]
 --------filter((count_t_one_side.score > 20) and (t1.id < 100))
 ----------PhysicalOlapScan[count_t_one_side]
+--------filter((count_t_one_side.id < 100))
+----------PhysicalOlapScan[count_t_one_side]
 
 -- !with_hint_groupby_pushdown_basic --
 PhysicalResultSink
@@ -506,9 +506,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side]
 --------filter((count_t_one_side.score > 10))
 ----------PhysicalOlapScan[count_t_one_side]
+--------PhysicalOlapScan[count_t_one_side]
 
 Hint log:
 Used:
@@ -533,9 +533,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side]
 --------filter((count_t_one_side.score > 10))
 ----------PhysicalOlapScan[count_t_one_side]
+--------PhysicalOlapScan[count_t_one_side]
 
 Hint log:
 Used:
@@ -655,9 +655,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side]
 --------filter((t1.score > 50))
 ----------PhysicalOlapScan[count_t_one_side]
+--------PhysicalOlapScan[count_t_one_side]
 
 Hint log:
 Used:
@@ -736,10 +736,10 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((count_t_one_side.id < 100))
-----------PhysicalOlapScan[count_t_one_side]
 --------filter((count_t_one_side.score > 20) and (t1.id < 100))
 ----------PhysicalOlapScan[count_t_one_side]
+--------filter((count_t_one_side.id < 100))
+----------PhysicalOlapScan[count_t_one_side]
 
 Hint log:
 Used:
@@ -855,9 +855,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side]
 --------filter((count_t_one_side.score > 10))
 ----------PhysicalOlapScan[count_t_one_side]
+--------PhysicalOlapScan[count_t_one_side]
 
 Hint log:
 Used:
@@ -882,9 +882,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side]
 --------filter((count_t_one_side.score > 10))
 ----------PhysicalOlapScan[count_t_one_side]
+--------PhysicalOlapScan[count_t_one_side]
 
 Hint log:
 Used:
@@ -965,9 +965,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side]
 --------filter((t1.score > 50))
 ----------PhysicalOlapScan[count_t_one_side]
+--------PhysicalOlapScan[count_t_one_side]
 
 Hint log:
 Used:
@@ -1020,10 +1020,10 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((count_t_one_side.id < 100))
-----------PhysicalOlapScan[count_t_one_side]
 --------filter((count_t_one_side.score > 20) and (t1.id < 100))
 ----------PhysicalOlapScan[count_t_one_side]
+--------filter((count_t_one_side.id < 100))
+----------PhysicalOlapScan[count_t_one_side]
 
 Hint log:
 Used:
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_max_through_join.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_max_through_join.out
index 281de8ea61b88e..9b4e17b4369471 100644
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_max_through_join.out
+++ b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_max_through_join.out
@@ -68,9 +68,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t]
 --------filter((max_t.score > 10))
 ----------PhysicalOlapScan[max_t]
+--------PhysicalOlapScan[max_t]
 
 -- !groupby_pushdown_outer_join --
 PhysicalResultSink
@@ -85,9 +85,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t]
 --------filter((max_t.score > 10))
 ----------PhysicalOlapScan[max_t]
+--------PhysicalOlapScan[max_t]
 
 -- !groupby_pushdown_having --
 PhysicalResultSink
@@ -163,9 +163,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t]
 --------filter((t1.score > 50))
 ----------PhysicalOlapScan[max_t]
+--------PhysicalOlapScan[max_t]
 
 -- !groupby_pushdown_varied_aggregates --
 PhysicalResultSink
@@ -214,10 +214,10 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((max_t.id < 100))
-----------PhysicalOlapScan[max_t]
 --------filter((max_t.score > 20) and (t1.id < 100))
 ----------PhysicalOlapScan[max_t]
+--------filter((max_t.id < 100))
+----------PhysicalOlapScan[max_t]
 
 -- !with_hint_groupby_pushdown_basic --
 PhysicalResultSink
@@ -328,9 +328,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t]
 --------filter((max_t.score > 10))
 ----------PhysicalOlapScan[max_t]
+--------PhysicalOlapScan[max_t]
 
 Hint log:
 Used:
@@ -355,9 +355,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t]
 --------filter((max_t.score > 10))
 ----------PhysicalOlapScan[max_t]
+--------PhysicalOlapScan[max_t]
 
 Hint log:
 Used:
@@ -478,9 +478,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t]
 --------filter((t1.score > 50))
 ----------PhysicalOlapScan[max_t]
+--------PhysicalOlapScan[max_t]
 
 Hint log:
 Used:
@@ -559,10 +559,10 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((max_t.id < 100))
-----------PhysicalOlapScan[max_t]
 --------filter((max_t.score > 20) and (t1.id < 100))
 ----------PhysicalOlapScan[max_t]
+--------filter((max_t.id < 100))
+----------PhysicalOlapScan[max_t]
 
 Hint log:
 Used:
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_min_through_join.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_min_through_join.out
index d4efe7df093503..03e52839ecf459 100644
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_min_through_join.out
+++ b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_min_through_join.out
@@ -68,9 +68,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t]
 --------filter((min_t.score > 10))
 ----------PhysicalOlapScan[min_t]
+--------PhysicalOlapScan[min_t]
 
 -- !groupby_pushdown_outer_join --
 PhysicalResultSink
@@ -85,9 +85,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t]
 --------filter((min_t.score > 10))
 ----------PhysicalOlapScan[min_t]
+--------PhysicalOlapScan[min_t]
 
 -- !groupby_pushdown_having --
 PhysicalResultSink
@@ -163,9 +163,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t]
 --------filter((t1.score > 50))
 ----------PhysicalOlapScan[min_t]
+--------PhysicalOlapScan[min_t]
 
 -- !groupby_pushdown_varied_aggregates --
 PhysicalResultSink
@@ -214,10 +214,10 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((min_t.id < 100))
-----------PhysicalOlapScan[min_t]
 --------filter((min_t.score > 20) and (t1.id < 100))
 ----------PhysicalOlapScan[min_t]
+--------filter((min_t.id < 100))
+----------PhysicalOlapScan[min_t]
 
 -- !with_hint_groupby_pushdown_basic --
 PhysicalResultSink
@@ -328,9 +328,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t]
 --------filter((min_t.score > 10))
 ----------PhysicalOlapScan[min_t]
+--------PhysicalOlapScan[min_t]
 
 Hint log:
 Used:
@@ -355,9 +355,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t]
 --------filter((min_t.score > 10))
 ----------PhysicalOlapScan[min_t]
+--------PhysicalOlapScan[min_t]
 
 Hint log:
 Used:
@@ -478,9 +478,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t]
 --------filter((t1.score > 50))
 ----------PhysicalOlapScan[min_t]
+--------PhysicalOlapScan[min_t]
 
 Hint log:
 Used:
@@ -559,10 +559,10 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((min_t.id < 100))
-----------PhysicalOlapScan[min_t]
 --------filter((min_t.score > 20) and (t1.id < 100))
 ----------PhysicalOlapScan[min_t]
+--------filter((min_t.id < 100))
+----------PhysicalOlapScan[min_t]
 
 Hint log:
 Used:
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.out
index 9d20fb8b02dd52..62930e78a096f8 100644
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.out
+++ b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.out
@@ -68,9 +68,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t]
 --------filter((sum_t.score > 10))
 ----------PhysicalOlapScan[sum_t]
+--------PhysicalOlapScan[sum_t]
 
 -- !groupby_pushdown_outer_join --
 PhysicalResultSink
@@ -85,9 +85,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t]
 --------filter((sum_t.score > 10))
 ----------PhysicalOlapScan[sum_t]
+--------PhysicalOlapScan[sum_t]
 
 -- !groupby_pushdown_having --
 PhysicalResultSink
@@ -163,9 +163,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t]
 --------filter((t1.score > 50))
 ----------PhysicalOlapScan[sum_t]
+--------PhysicalOlapScan[sum_t]
 
 -- !groupby_pushdown_varied_aggregates --
 PhysicalResultSink
@@ -214,10 +214,10 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((sum_t.id < 100))
-----------PhysicalOlapScan[sum_t]
 --------filter((sum_t.score > 20) and (t1.id < 100))
 ----------PhysicalOlapScan[sum_t]
+--------filter((sum_t.id < 100))
+----------PhysicalOlapScan[sum_t]
 
 -- !with_hint_groupby_pushdown_basic --
 PhysicalResultSink
@@ -328,9 +328,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t]
 --------filter((sum_t.score > 10))
 ----------PhysicalOlapScan[sum_t]
+--------PhysicalOlapScan[sum_t]
 
 Hint log:
 Used:
@@ -355,9 +355,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t]
 --------filter((sum_t.score > 10))
 ----------PhysicalOlapScan[sum_t]
+--------PhysicalOlapScan[sum_t]
 
 Hint log:
 Used:
@@ -478,9 +478,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t]
 --------filter((t1.score > 50))
 ----------PhysicalOlapScan[sum_t]
+--------PhysicalOlapScan[sum_t]
 
 Hint log:
 Used:
@@ -559,10 +559,10 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((sum_t.id < 100))
-----------PhysicalOlapScan[sum_t]
 --------filter((sum_t.score > 20) and (t1.id < 100))
 ----------PhysicalOlapScan[sum_t]
+--------filter((sum_t.id < 100))
+----------PhysicalOlapScan[sum_t]
 
 Hint log:
 Used:
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.out
index 5013dc7dbdfb93..7b55ac7b08bf11 100644
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.out
+++ b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.out
@@ -68,9 +68,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side]
 --------filter((sum_t_one_side.score > 10))
 ----------PhysicalOlapScan[sum_t_one_side]
+--------PhysicalOlapScan[sum_t_one_side]
 
 -- !groupby_pushdown_outer_join --
 PhysicalResultSink
@@ -85,9 +85,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side]
 --------filter((sum_t_one_side.score > 10))
 ----------PhysicalOlapScan[sum_t_one_side]
+--------PhysicalOlapScan[sum_t_one_side]
 
 -- !groupby_pushdown_having --
 PhysicalResultSink
@@ -163,9 +163,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side]
 --------filter((t1.score > 50))
 ----------PhysicalOlapScan[sum_t_one_side]
+--------PhysicalOlapScan[sum_t_one_side]
 
 -- !groupby_pushdown_varied_aggregates --
 PhysicalResultSink
@@ -214,10 +214,10 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((sum_t_one_side.id < 100))
-----------PhysicalOlapScan[sum_t_one_side]
 --------filter((sum_t_one_side.score > 20) and (t1.id < 100))
 ----------PhysicalOlapScan[sum_t_one_side]
+--------filter((sum_t_one_side.id < 100))
+----------PhysicalOlapScan[sum_t_one_side]
 
 -- !with_hint_groupby_pushdown_basic --
 PhysicalResultSink
@@ -328,9 +328,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side]
 --------filter((sum_t_one_side.score > 10))
 ----------PhysicalOlapScan[sum_t_one_side]
+--------PhysicalOlapScan[sum_t_one_side]
 
 Hint log:
 Used:
@@ -355,9 +355,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side]
 --------filter((sum_t_one_side.score > 10))
 ----------PhysicalOlapScan[sum_t_one_side]
+--------PhysicalOlapScan[sum_t_one_side]
 
 Hint log:
 Used:
@@ -478,9 +478,9 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side]
 --------filter((t1.score > 50))
 ----------PhysicalOlapScan[sum_t_one_side]
+--------PhysicalOlapScan[sum_t_one_side]
 
 Hint log:
 Used:
@@ -559,10 +559,10 @@ PhysicalResultSink
 --hashAgg[GLOBAL]
 ----hashAgg[LOCAL]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((sum_t_one_side.id < 100))
-----------PhysicalOlapScan[sum_t_one_side]
 --------filter((sum_t_one_side.score > 20) and (t1.id < 100))
 ----------PhysicalOlapScan[sum_t_one_side]
+--------filter((sum_t_one_side.id < 100))
+----------PhysicalOlapScan[sum_t_one_side]
 
 Hint log:
 Used:
diff --git a/regression-test/data/nereids_rules_p0/eliminate_outer_join/eliminate_outer_join.out b/regression-test/data/nereids_rules_p0/eliminate_outer_join/eliminate_outer_join.out
index c08e68d3c72419..e2e4e0c7804c8a 100644
--- a/regression-test/data/nereids_rules_p0/eliminate_outer_join/eliminate_outer_join.out
+++ b/regression-test/data/nereids_rules_p0/eliminate_outer_join/eliminate_outer_join.out
@@ -11,17 +11,17 @@ PhysicalResultSink
 PhysicalResultSink
 --PhysicalDistribute[DistributionSpecGather]
 ----hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------PhysicalOlapScan[t]
 ------filter((t1.score > 10))
 --------PhysicalOlapScan[t]
+------PhysicalOlapScan[t]
 
 -- !full_outer_join --
 PhysicalResultSink
 --PhysicalDistribute[DistributionSpecGather]
-----hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------PhysicalOlapScan[t]
+----hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
 ------filter((t1.score > 10))
 --------PhysicalOlapScan[t]
+------PhysicalOlapScan[t]
 
 -- !full_outer_join --
 PhysicalResultSink
@@ -53,10 +53,10 @@ PhysicalResultSink
 PhysicalResultSink
 --PhysicalDistribute[DistributionSpecGather]
 ----hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=()
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[t]
+------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
 --------filter((t1.score > 10))
 ----------PhysicalOlapScan[t]
+--------PhysicalOlapScan[t]
 ------PhysicalOlapScan[t]
 
 -- !multiple_left_outer_2 --
@@ -73,30 +73,30 @@ PhysicalResultSink
 PhysicalResultSink
 --PhysicalDistribute[DistributionSpecGather]
 ----hashJoin[INNER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=()
-------PhysicalOlapScan[t]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[t]
 --------filter((t1.score > 10))
 ----------PhysicalOlapScan[t]
+--------PhysicalOlapScan[t]
+------PhysicalOlapScan[t]
 
 -- !multiple_right_outer_2 --
 PhysicalResultSink
 --PhysicalDistribute[DistributionSpecGather]
 ----hashJoin[INNER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=()
-------PhysicalOlapScan[t]
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
 --------PhysicalOlapScan[t]
 --------filter((t2.score > 10))
 ----------PhysicalOlapScan[t]
+------PhysicalOlapScan[t]
 
 -- !multiple_full_outer_1 --
 PhysicalResultSink
 --PhysicalDistribute[DistributionSpecGather]
 ----hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=()
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[t]
+------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
 --------filter((t1.score > 10))
 ----------PhysicalOlapScan[t]
+--------PhysicalOlapScan[t]
 ------PhysicalOlapScan[t]
 
 -- !multiple_full_outer_2 --
@@ -114,10 +114,10 @@ PhysicalResultSink
 -- !left_outer_join_non_null_assertion --
 PhysicalResultSink
 --PhysicalDistribute[DistributionSpecGather]
-----hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------PhysicalOlapScan[t]
+----hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
 ------filter(( not id IS NULL) and (t1.score > 5))
 --------PhysicalOlapScan[t]
+------PhysicalOlapScan[t]
 
 -- !right_outer_join_non_null_assertion --
 PhysicalResultSink
@@ -140,9 +140,9 @@ PhysicalResultSink
 --PhysicalDistribute[DistributionSpecGather]
 ----hashJoin[INNER_JOIN] hashCondition=((t2.id = t3.id)) otherCondition=()
 ------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[t]
 --------filter((t1.score > 5))
 ----------PhysicalOlapScan[t]
+--------PhysicalOlapScan[t]
 ------filter(( not score IS NULL))
 --------PhysicalOlapScan[t]
 
@@ -165,7 +165,7 @@ PhysicalResultSink
 ----PhysicalProject
 ------filter((count(id) > 1))
 --------hashAgg[LOCAL]
-----------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
+----------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
 ------------PhysicalProject
 --------------PhysicalOlapScan[t]
 ------------PhysicalProject
@@ -185,28 +185,28 @@ PhysicalResultSink
 PhysicalResultSink
 --PhysicalDistribute[DistributionSpecGather]
 ----hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------filter(( not name IS NULL))
---------PhysicalOlapScan[t]
 ------filter((t1.score > 10))
 --------PhysicalOlapScan[t]
+------filter(( not name IS NULL))
+--------PhysicalOlapScan[t]
 
 -- !right_outer --
 PhysicalResultSink
 --PhysicalDistribute[DistributionSpecGather]
 ----hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------filter(( not name IS NULL))
---------PhysicalOlapScan[t]
 ------filter((t1.score > 10))
 --------PhysicalOlapScan[t]
+------filter(( not name IS NULL))
+--------PhysicalOlapScan[t]
 
 -- !full_outer --
 PhysicalResultSink
 --PhysicalDistribute[DistributionSpecGather]
 ----hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------filter(( not name IS NULL))
---------PhysicalOlapScan[t]
 ------filter((t1.score > 10))
 --------PhysicalOlapScan[t]
+------filter(( not name IS NULL))
+--------PhysicalOlapScan[t]
 
 -- !self_left_outer --
 PhysicalResultSink
diff --git a/regression-test/suites/nereids_rules_p0/eager_aggregate/basic.groovy b/regression-test/suites/nereids_rules_p0/eager_aggregate/basic.groovy
index 117d0c01f24838..2cb7a0ff77cee0 100644
--- a/regression-test/suites/nereids_rules_p0/eager_aggregate/basic.groovy
+++ b/regression-test/suites/nereids_rules_p0/eager_aggregate/basic.groovy
@@ -22,6 +22,7 @@ suite("eager_aggregate_basic") {
     sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'"
     
     sql "set disable_nereids_rules=PRUNE_EMPTY_PARTITION"
+    sql "set disable_join_reorder=true"
 
     sql """
         DROP TABLE IF EXISTS shunt_log_com_dd_library;
diff --git a/regression-test/suites/nereids_rules_p0/eager_aggregate/basic_one_side.groovy b/regression-test/suites/nereids_rules_p0/eager_aggregate/basic_one_side.groovy
index f3e6f593aa96c2..fd182c360c860d 100644
--- a/regression-test/suites/nereids_rules_p0/eager_aggregate/basic_one_side.groovy
+++ b/regression-test/suites/nereids_rules_p0/eager_aggregate/basic_one_side.groovy
@@ -22,6 +22,7 @@ suite("eager_aggregate_basic_one_side") {
     sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'"
 
     sql "set disable_nereids_rules=PRUNE_EMPTY_PARTITION"
+    sql "set disable_join_reorder=true"
 
     sql """
         DROP TABLE IF EXISTS shunt_log_com_dd_library_one_side;
diff --git a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_count_through_join.groovy b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_count_through_join.groovy
index 33b2f888f155f7..bdb59285428f50 100644
--- a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_count_through_join.groovy
+++ b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_count_through_join.groovy
@@ -20,6 +20,7 @@ suite("push_down_count_through_join") {
     sql "set runtime_filter_mode=OFF"
     sql "SET enable_fallback_to_original_planner=false"
     sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'"
+    sql "set disable_join_reorder=true"
 
     sql """
         DROP TABLE IF EXISTS count_t;
diff --git a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.groovy b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.groovy
index 595e5fc3706038..6e3c974941c8f5 100644
--- a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.groovy
+++ b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.groovy
@@ -25,6 +25,7 @@ suite("push_down_count_through_join_one_side") {
     sql """
         DROP TABLE IF EXISTS count_t_one_side;
     """
+    sql "set disable_join_reorder=true"
 
     sql """
     CREATE TABLE IF NOT EXISTS count_t_one_side(
diff --git a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_max_through_join.groovy b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_max_through_join.groovy
index 1b3d2d44fcd087..556dc83fcc7a2e 100644
--- a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_max_through_join.groovy
+++ b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_max_through_join.groovy
@@ -47,7 +47,8 @@ suite("push_down_max_through_join") {
     sql "insert into max_t values (8, null, 'c')"
     sql "insert into max_t values (9, 3, null)"
     sql "insert into max_t values (10, null, null)"
-
+    sql "set disable_join_reorder=true"
+    
     qt_groupby_pushdown_basic """
         explain shape plan select max(t1.score) from max_t t1, max_t t2 where t1.id = t2.id group by t1.name;
     """
diff --git a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_min_through_join.groovy b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_min_through_join.groovy
index c93dfe53d80c1e..cb695321f46136 100644
--- a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_min_through_join.groovy
+++ b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_min_through_join.groovy
@@ -20,6 +20,7 @@ suite("push_down_min_through_join") {
     sql "set runtime_filter_mode=OFF"
     sql "SET enable_fallback_to_original_planner=false"
     sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'"
+    sql "set disable_join_reorder=true"
 
     sql """
         DROP TABLE IF EXISTS min_t;
diff --git a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.groovy b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.groovy
index 4f9470860b25ee..f3aaed71734e86 100644
--- a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.groovy
+++ b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.groovy
@@ -20,6 +20,7 @@ suite("push_down_sum_through_join") {
     sql "set runtime_filter_mode=OFF"
     sql "SET enable_fallback_to_original_planner=false"
     sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'"
+    sql "set disable_join_reorder=true"
 
     sql """
         DROP TABLE IF EXISTS sum_t;
diff --git a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.groovy b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.groovy
index 1910c294de42b9..a4ebb4b7d2fe04 100644
--- a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.groovy
+++ b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.groovy
@@ -20,6 +20,7 @@ suite("push_down_sum_through_join_one_side") {
     sql "set runtime_filter_mode=OFF"
     sql "SET enable_fallback_to_original_planner=false"
     sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'"
+    sql "set disable_join_reorder=true"
 
     sql """
         DROP TABLE IF EXISTS sum_t_one_side;
diff --git a/regression-test/suites/nereids_rules_p0/eliminate_outer_join/eliminate_outer_join.groovy b/regression-test/suites/nereids_rules_p0/eliminate_outer_join/eliminate_outer_join.groovy
index 81492dd7d4875c..871d95a053a119 100644
--- a/regression-test/suites/nereids_rules_p0/eliminate_outer_join/eliminate_outer_join.groovy
+++ b/regression-test/suites/nereids_rules_p0/eliminate_outer_join/eliminate_outer_join.groovy
@@ -21,7 +21,7 @@ suite("eliminate_outer_join") {
     sql "SET enable_fallback_to_original_planner=false"
     sql "set disable_nereids_rules=PRUNE_EMPTY_PARTITION"
     sql 'set be_number_for_test=3'
-
+    sql 'set disable_join_reorder=true'
     sql """
         DROP TABLE IF EXISTS t
     """