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

morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new f6018394007 branch-3.1: [test](mv) Fix mv regression test is not 
chosen stable by CBO #50690 (#52022)
f6018394007 is described below

commit f6018394007e65b691980f7f18f7bf296fbf6905
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Jun 20 14:58:08 2025 +0800

    branch-3.1: [test](mv) Fix mv regression test is not chosen stable by CBO 
#50690 (#52022)
    
    Cherry-picked from #50690
    
    Co-authored-by: seawinde <[email protected]>
---
 .../data/mv_p0/test_dup_mv_plus/test_dup_mv_plus.out    | Bin 436 -> 531 bytes
 .../ut/testAggQueryOnAggMV10/testAggQueryOnAggMV10.out  | Bin 264 -> 349 bytes
 .../ut/testAggQueryOnAggMV11/testAggQueryOnAggMV11.out  | Bin 229 -> 292 bytes
 .../ut/testAggQueryOnAggMV2/testAggQueryOnAggMV2.out    | Bin 235 -> 300 bytes
 .../ut/testAggQueryOnAggMV3/testAggQueryOnAggMV3.out    | Bin 241 -> 327 bytes
 .../ut/testAggQuqeryOnAggMV5/testAggQuqeryOnAggMV5.out  | Bin 217 -> 301 bytes
 .../ut/testAggQuqeryOnAggMV7/testAggQuqeryOnAggMV7.out  | Bin 217 -> 301 bytes
 .../testAggregateMVCalcAggFunctionQuery.out             | Bin 217 -> 301 bytes
 .../testBitmapUnionInQuery/testBitmapUnionInQuery.out   | Bin 210 -> 261 bytes
 .../testCountDistinctToBitmap.out                       | Bin 281 -> 332 bytes
 .../testIncorrectMVRewriteInSubquery.out                | Bin 189 -> 240 bytes
 .../testIncorrectRewriteCountDistinct.out               | Bin 192 -> 243 bytes
 .../testJoinOnLeftProjectToJoin.out                     | Bin 129 -> 130 bytes
 .../data/mv_p0/ut/testNDVToHll/testNDVToHll.out         | Bin 218 -> 269 bytes
 .../testOrderByQueryOnProjectView.out                   | Bin 225 -> 317 bytes
 .../mv_p0/ut/testProjectionMV1/testProjectionMV1.out    | Bin 260 -> 335 bytes
 .../mv_p0/ut/testProjectionMV2/testProjectionMV2.out    | Bin 224 -> 295 bytes
 .../mv_p0/ut/testProjectionMV3/testProjectionMV3.out    | Bin 227 -> 302 bytes
 .../mv_p0/ut/testProjectionMV4/testProjectionMV4.out    | Bin 220 -> 287 bytes
 .../testSingleMVMultiUsage/testSingleMVMultiUsage.out   | Bin 217 -> 301 bytes
 .../data/mv_p0/ut/testSubQuery/testSubQuery.out         | Bin 241 -> 349 bytes
 .../mv_p0/ut/testUnionDistinct/testUnionDistinct.out    | Bin 225 -> 309 bytes
 .../mv_p0/test_dup_mv_plus/test_dup_mv_plus.groovy      |   6 +++++-
 .../testAggQueryOnAggMV10/testAggQueryOnAggMV10.groovy  |   6 +++++-
 .../testAggQueryOnAggMV11/testAggQueryOnAggMV11.groovy  |   6 +++++-
 .../ut/testAggQueryOnAggMV2/testAggQueryOnAggMV2.groovy |   5 ++++-
 .../ut/testAggQueryOnAggMV3/testAggQueryOnAggMV3.groovy |   6 +++++-
 .../testAggQuqeryOnAggMV5/testAggQuqeryOnAggMV5.groovy  |   6 +++++-
 .../testAggQuqeryOnAggMV7/testAggQuqeryOnAggMV7.groovy  |   7 +++++--
 .../testAggTableCountDistinctInBitmapType.groovy        |   5 ++++-
 .../testAggregateMVCalcAggFunctionQuery.groovy          |   6 +++++-
 .../testBitmapUnionInQuery.groovy                       |   5 ++++-
 .../testCountDistinctToBitmap.groovy                    |   5 ++++-
 .../testIncorrectMVRewriteInSubquery.groovy             |   5 ++++-
 .../testIncorrectRewriteCountDistinct.groovy            |   5 ++++-
 .../testJoinOnLeftProjectToJoin.groovy                  |  10 ++++++++--
 .../suites/mv_p0/ut/testNDVToHll/testNDVToHll.groovy    |   5 ++++-
 .../testOrderByQueryOnProjectView.groovy                |   6 +++++-
 .../mv_p0/ut/testProjectionMV1/testProjectionMV1.groovy |   5 ++++-
 .../mv_p0/ut/testProjectionMV2/testProjectionMV2.groovy |   5 ++++-
 .../mv_p0/ut/testProjectionMV3/testProjectionMV3.groovy |   5 ++++-
 .../mv_p0/ut/testProjectionMV4/testProjectionMV4.groovy |   5 ++++-
 .../testSingleMVMultiUsage.groovy                       |   6 +++++-
 .../suites/mv_p0/ut/testSubQuery/testSubQuery.groovy    |   6 +++++-
 .../mv_p0/ut/testUnionDistinct/testUnionDistinct.groovy |   6 +++++-
 .../mv/union_rewrite/usercase_union_rewrite.groovy      |   2 +-
 46 files changed, 108 insertions(+), 26 deletions(-)

diff --git a/regression-test/data/mv_p0/test_dup_mv_plus/test_dup_mv_plus.out 
b/regression-test/data/mv_p0/test_dup_mv_plus/test_dup_mv_plus.out
index 0f9a3544165..91228895b36 100644
Binary files a/regression-test/data/mv_p0/test_dup_mv_plus/test_dup_mv_plus.out 
and b/regression-test/data/mv_p0/test_dup_mv_plus/test_dup_mv_plus.out differ
diff --git 
a/regression-test/data/mv_p0/ut/testAggQueryOnAggMV10/testAggQueryOnAggMV10.out 
b/regression-test/data/mv_p0/ut/testAggQueryOnAggMV10/testAggQueryOnAggMV10.out
index 83bfded26fc..c14d0402be3 100644
Binary files 
a/regression-test/data/mv_p0/ut/testAggQueryOnAggMV10/testAggQueryOnAggMV10.out 
and 
b/regression-test/data/mv_p0/ut/testAggQueryOnAggMV10/testAggQueryOnAggMV10.out 
differ
diff --git 
a/regression-test/data/mv_p0/ut/testAggQueryOnAggMV11/testAggQueryOnAggMV11.out 
b/regression-test/data/mv_p0/ut/testAggQueryOnAggMV11/testAggQueryOnAggMV11.out
index d0b1871ed2f..e12b89b07a3 100644
Binary files 
a/regression-test/data/mv_p0/ut/testAggQueryOnAggMV11/testAggQueryOnAggMV11.out 
and 
b/regression-test/data/mv_p0/ut/testAggQueryOnAggMV11/testAggQueryOnAggMV11.out 
differ
diff --git 
a/regression-test/data/mv_p0/ut/testAggQueryOnAggMV2/testAggQueryOnAggMV2.out 
b/regression-test/data/mv_p0/ut/testAggQueryOnAggMV2/testAggQueryOnAggMV2.out
index 94559632cba..ae6b7ab10b8 100644
Binary files 
a/regression-test/data/mv_p0/ut/testAggQueryOnAggMV2/testAggQueryOnAggMV2.out 
and 
b/regression-test/data/mv_p0/ut/testAggQueryOnAggMV2/testAggQueryOnAggMV2.out 
differ
diff --git 
a/regression-test/data/mv_p0/ut/testAggQueryOnAggMV3/testAggQueryOnAggMV3.out 
b/regression-test/data/mv_p0/ut/testAggQueryOnAggMV3/testAggQueryOnAggMV3.out
index 0ae3aec19b4..165729c3dbc 100644
Binary files 
a/regression-test/data/mv_p0/ut/testAggQueryOnAggMV3/testAggQueryOnAggMV3.out 
and 
b/regression-test/data/mv_p0/ut/testAggQueryOnAggMV3/testAggQueryOnAggMV3.out 
differ
diff --git 
a/regression-test/data/mv_p0/ut/testAggQuqeryOnAggMV5/testAggQuqeryOnAggMV5.out 
b/regression-test/data/mv_p0/ut/testAggQuqeryOnAggMV5/testAggQuqeryOnAggMV5.out
index b10e432dadb..6d14c178c4b 100644
Binary files 
a/regression-test/data/mv_p0/ut/testAggQuqeryOnAggMV5/testAggQuqeryOnAggMV5.out 
and 
b/regression-test/data/mv_p0/ut/testAggQuqeryOnAggMV5/testAggQuqeryOnAggMV5.out 
differ
diff --git 
a/regression-test/data/mv_p0/ut/testAggQuqeryOnAggMV7/testAggQuqeryOnAggMV7.out 
b/regression-test/data/mv_p0/ut/testAggQuqeryOnAggMV7/testAggQuqeryOnAggMV7.out
index b10e432dadb..6d14c178c4b 100644
Binary files 
a/regression-test/data/mv_p0/ut/testAggQuqeryOnAggMV7/testAggQuqeryOnAggMV7.out 
and 
b/regression-test/data/mv_p0/ut/testAggQuqeryOnAggMV7/testAggQuqeryOnAggMV7.out 
differ
diff --git 
a/regression-test/data/mv_p0/ut/testAggregateMVCalcAggFunctionQuery/testAggregateMVCalcAggFunctionQuery.out
 
b/regression-test/data/mv_p0/ut/testAggregateMVCalcAggFunctionQuery/testAggregateMVCalcAggFunctionQuery.out
index b10e432dadb..6d14c178c4b 100644
Binary files 
a/regression-test/data/mv_p0/ut/testAggregateMVCalcAggFunctionQuery/testAggregateMVCalcAggFunctionQuery.out
 and 
b/regression-test/data/mv_p0/ut/testAggregateMVCalcAggFunctionQuery/testAggregateMVCalcAggFunctionQuery.out
 differ
diff --git 
a/regression-test/data/mv_p0/ut/testBitmapUnionInQuery/testBitmapUnionInQuery.out
 
b/regression-test/data/mv_p0/ut/testBitmapUnionInQuery/testBitmapUnionInQuery.out
index 75a47cb3319..d8a22797e50 100644
Binary files 
a/regression-test/data/mv_p0/ut/testBitmapUnionInQuery/testBitmapUnionInQuery.out
 and 
b/regression-test/data/mv_p0/ut/testBitmapUnionInQuery/testBitmapUnionInQuery.out
 differ
diff --git 
a/regression-test/data/mv_p0/ut/testCountDistinctToBitmap/testCountDistinctToBitmap.out
 
b/regression-test/data/mv_p0/ut/testCountDistinctToBitmap/testCountDistinctToBitmap.out
index e5696983e12..75885fdb163 100644
Binary files 
a/regression-test/data/mv_p0/ut/testCountDistinctToBitmap/testCountDistinctToBitmap.out
 and 
b/regression-test/data/mv_p0/ut/testCountDistinctToBitmap/testCountDistinctToBitmap.out
 differ
diff --git 
a/regression-test/data/mv_p0/ut/testIncorrectMVRewriteInSubquery/testIncorrectMVRewriteInSubquery.out
 
b/regression-test/data/mv_p0/ut/testIncorrectMVRewriteInSubquery/testIncorrectMVRewriteInSubquery.out
index ab95a5b36fa..ba6d1c2674a 100644
Binary files 
a/regression-test/data/mv_p0/ut/testIncorrectMVRewriteInSubquery/testIncorrectMVRewriteInSubquery.out
 and 
b/regression-test/data/mv_p0/ut/testIncorrectMVRewriteInSubquery/testIncorrectMVRewriteInSubquery.out
 differ
diff --git 
a/regression-test/data/mv_p0/ut/testIncorrectRewriteCountDistinct/testIncorrectRewriteCountDistinct.out
 
b/regression-test/data/mv_p0/ut/testIncorrectRewriteCountDistinct/testIncorrectRewriteCountDistinct.out
index dd06cd3927c..5f491967b17 100644
Binary files 
a/regression-test/data/mv_p0/ut/testIncorrectRewriteCountDistinct/testIncorrectRewriteCountDistinct.out
 and 
b/regression-test/data/mv_p0/ut/testIncorrectRewriteCountDistinct/testIncorrectRewriteCountDistinct.out
 differ
diff --git 
a/regression-test/data/mv_p0/ut/testJoinOnLeftProjectToJoin/testJoinOnLeftProjectToJoin.out
 
b/regression-test/data/mv_p0/ut/testJoinOnLeftProjectToJoin/testJoinOnLeftProjectToJoin.out
index cf5140bb022..838e50a149c 100644
Binary files 
a/regression-test/data/mv_p0/ut/testJoinOnLeftProjectToJoin/testJoinOnLeftProjectToJoin.out
 and 
b/regression-test/data/mv_p0/ut/testJoinOnLeftProjectToJoin/testJoinOnLeftProjectToJoin.out
 differ
diff --git a/regression-test/data/mv_p0/ut/testNDVToHll/testNDVToHll.out 
b/regression-test/data/mv_p0/ut/testNDVToHll/testNDVToHll.out
index 7afb3700d9e..dc95ffa41f4 100644
Binary files a/regression-test/data/mv_p0/ut/testNDVToHll/testNDVToHll.out and 
b/regression-test/data/mv_p0/ut/testNDVToHll/testNDVToHll.out differ
diff --git 
a/regression-test/data/mv_p0/ut/testOrderByQueryOnProjectView/testOrderByQueryOnProjectView.out
 
b/regression-test/data/mv_p0/ut/testOrderByQueryOnProjectView/testOrderByQueryOnProjectView.out
index beefefba56c..ae4b592b5dc 100644
Binary files 
a/regression-test/data/mv_p0/ut/testOrderByQueryOnProjectView/testOrderByQueryOnProjectView.out
 and 
b/regression-test/data/mv_p0/ut/testOrderByQueryOnProjectView/testOrderByQueryOnProjectView.out
 differ
diff --git 
a/regression-test/data/mv_p0/ut/testProjectionMV1/testProjectionMV1.out 
b/regression-test/data/mv_p0/ut/testProjectionMV1/testProjectionMV1.out
index 523176bb0a5..adbcee9429d 100644
Binary files 
a/regression-test/data/mv_p0/ut/testProjectionMV1/testProjectionMV1.out and 
b/regression-test/data/mv_p0/ut/testProjectionMV1/testProjectionMV1.out differ
diff --git 
a/regression-test/data/mv_p0/ut/testProjectionMV2/testProjectionMV2.out 
b/regression-test/data/mv_p0/ut/testProjectionMV2/testProjectionMV2.out
index 934d3208d48..2a4293882a6 100644
Binary files 
a/regression-test/data/mv_p0/ut/testProjectionMV2/testProjectionMV2.out and 
b/regression-test/data/mv_p0/ut/testProjectionMV2/testProjectionMV2.out differ
diff --git 
a/regression-test/data/mv_p0/ut/testProjectionMV3/testProjectionMV3.out 
b/regression-test/data/mv_p0/ut/testProjectionMV3/testProjectionMV3.out
index 9537036f412..c8c96b24383 100644
Binary files 
a/regression-test/data/mv_p0/ut/testProjectionMV3/testProjectionMV3.out and 
b/regression-test/data/mv_p0/ut/testProjectionMV3/testProjectionMV3.out differ
diff --git 
a/regression-test/data/mv_p0/ut/testProjectionMV4/testProjectionMV4.out 
b/regression-test/data/mv_p0/ut/testProjectionMV4/testProjectionMV4.out
index 45a962ed59c..52a5842d59d 100644
Binary files 
a/regression-test/data/mv_p0/ut/testProjectionMV4/testProjectionMV4.out and 
b/regression-test/data/mv_p0/ut/testProjectionMV4/testProjectionMV4.out differ
diff --git 
a/regression-test/data/mv_p0/ut/testSingleMVMultiUsage/testSingleMVMultiUsage.out
 
b/regression-test/data/mv_p0/ut/testSingleMVMultiUsage/testSingleMVMultiUsage.out
index b10e432dadb..6d14c178c4b 100644
Binary files 
a/regression-test/data/mv_p0/ut/testSingleMVMultiUsage/testSingleMVMultiUsage.out
 and 
b/regression-test/data/mv_p0/ut/testSingleMVMultiUsage/testSingleMVMultiUsage.out
 differ
diff --git a/regression-test/data/mv_p0/ut/testSubQuery/testSubQuery.out 
b/regression-test/data/mv_p0/ut/testSubQuery/testSubQuery.out
index a30c9136e42..a0a66b8ef87 100644
Binary files a/regression-test/data/mv_p0/ut/testSubQuery/testSubQuery.out and 
b/regression-test/data/mv_p0/ut/testSubQuery/testSubQuery.out differ
diff --git 
a/regression-test/data/mv_p0/ut/testUnionDistinct/testUnionDistinct.out 
b/regression-test/data/mv_p0/ut/testUnionDistinct/testUnionDistinct.out
index cd7fbba9aa2..e2c8e5e603d 100644
Binary files 
a/regression-test/data/mv_p0/ut/testUnionDistinct/testUnionDistinct.out and 
b/regression-test/data/mv_p0/ut/testUnionDistinct/testUnionDistinct.out differ
diff --git 
a/regression-test/suites/mv_p0/test_dup_mv_plus/test_dup_mv_plus.groovy 
b/regression-test/suites/mv_p0/test_dup_mv_plus/test_dup_mv_plus.groovy
index 86f06b665df..213d8853db2 100644
--- a/regression-test/suites/mv_p0/test_dup_mv_plus/test_dup_mv_plus.groovy
+++ b/regression-test/suites/mv_p0/test_dup_mv_plus/test_dup_mv_plus.groovy
@@ -33,15 +33,19 @@ suite ("test_dup_mv_plus") {
         """
 
     sql "insert into d_table select 1,1,1,'a';"
+    sql "insert into d_table select 1,1,1,'a';"
+    sql "insert into d_table select 2,2,2,'b';"
     sql "insert into d_table select 2,2,2,'b';"
     sql "insert into d_table select 3,-3,null,'c';"
+    sql "insert into d_table select 3,-3,null,'c';"
 
     createMV ("create materialized view k12p as select k1,k2+1 from d_table;")
 
+    sql "insert into d_table select -4,-4,-4,'d';"
     sql "insert into d_table select -4,-4,-4,'d';"
 
     sql "analyze table d_table with sync;"
-    sql """alter table d_table modify column k4 set stats ('row_count'='3');"""
+    sql """alter table d_table modify column k4 set stats ('row_count'='8');"""
     sql """set enable_stats=false;"""
 
     qt_select_star "select * from d_table order by k1;"
diff --git 
a/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV10/testAggQueryOnAggMV10.groovy
 
b/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV10/testAggQueryOnAggMV10.groovy
index 8747f7641a9..9ee40c2b80a 100644
--- 
a/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV10/testAggQueryOnAggMV10.groovy
+++ 
b/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV10/testAggQueryOnAggMV10.groovy
@@ -33,15 +33,19 @@ suite ("testAggQueryOnAggMV10") {
         """
 
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
+    sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
 
     createMV("create materialized view emps_mv as select deptno, commission, 
sum(salary) from emps group by deptno, commission;")
 
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
 
     sql "analyze table emps with sync;"
-    sql """alter table emps modify column time_col set stats 
('row_count'='4');"""
+    sql """alter table emps modify column time_col set stats 
('row_count'='8');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from emps order by empid;", "emps_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV11/testAggQueryOnAggMV11.groovy
 
b/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV11/testAggQueryOnAggMV11.groovy
index dcd4f05f76c..029117ff0ee 100644
--- 
a/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV11/testAggQueryOnAggMV11.groovy
+++ 
b/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV11/testAggQueryOnAggMV11.groovy
@@ -33,15 +33,19 @@ suite ("testAggQueryOnAggMV11") {
         """
 
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
 
     createMV("create materialized view emps_mv as select deptno, count(salary) 
from emps group by deptno;")
 
+
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
 
     sql "analyze table emps with sync;"
-    sql """alter table emps modify column time_col set stats 
('row_count'='4');"""
+    sql """alter table emps modify column time_col set stats 
('row_count'='8');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from emps order by empid;", "emps_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV2/testAggQueryOnAggMV2.groovy
 
b/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV2/testAggQueryOnAggMV2.groovy
index f2aadc63e17..a8c66710604 100644
--- 
a/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV2/testAggQueryOnAggMV2.groovy
+++ 
b/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV2/testAggQueryOnAggMV2.groovy
@@ -31,8 +31,11 @@ suite ("testAggQueryOnAggMV2") {
 
     
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
+    sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
     sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
     sql """insert into emps values("2020-01-02",2,"b",2,7,2);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,7,2);"""
 
     explain {
         sql("select deptno, sum(salary) from emps group by deptno order by 
deptno;")
@@ -43,7 +46,7 @@ suite ("testAggQueryOnAggMV2") {
     createMV("create materialized view emps_mv as select deptno, sum(salary) 
from emps group by deptno ;")
 
     sql "analyze table emps with sync;"
-    sql """alter table emps modify column time_col set stats 
('row_count'='3');"""
+    sql """alter table emps modify column time_col set stats 
('row_count'='6');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from emps order by empid;", "emps_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV3/testAggQueryOnAggMV3.groovy
 
b/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV3/testAggQueryOnAggMV3.groovy
index bf46b5b0af7..ab0e806a8eb 100644
--- 
a/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV3/testAggQueryOnAggMV3.groovy
+++ 
b/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV3/testAggQueryOnAggMV3.groovy
@@ -33,15 +33,19 @@ suite ("testAggQueryOnAggMV3") {
         """
 
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-03",3,"c",3,3,10);"""
+    sql """insert into emps values("2020-01-03",3,"c",3,3,10);"""
+    sql """insert into emps values("2020-01-04",4,"d",21,4,4);"""
     sql """insert into emps values("2020-01-04",4,"d",21,4,4);"""
 
 
     createMV("create materialized view emps_mv as select deptno, commission, 
sum(salary) from emps group by deptno, commission;")
 
     sql "analyze table emps with sync;"
-    sql """alter table emps modify column time_col set stats 
('row_count'='4');"""
+    sql """alter table emps modify column time_col set stats 
('row_count'='8');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from emps order by empid;", "emps_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testAggQuqeryOnAggMV5/testAggQuqeryOnAggMV5.groovy
 
b/regression-test/suites/mv_p0/ut/testAggQuqeryOnAggMV5/testAggQuqeryOnAggMV5.groovy
index 1e2b01dbc61..e57df1332ae 100644
--- 
a/regression-test/suites/mv_p0/ut/testAggQuqeryOnAggMV5/testAggQuqeryOnAggMV5.groovy
+++ 
b/regression-test/suites/mv_p0/ut/testAggQuqeryOnAggMV5/testAggQuqeryOnAggMV5.groovy
@@ -33,15 +33,19 @@ suite ("testAggQuqeryOnAggMV5") {
         """
 
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
+    sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
 
     createMV("create materialized view emps_mv as select deptno, commission, 
sum(salary) from emps group by deptno, commission;")
 
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
 
     sql """analyze table emps with sync;"""
-    sql """alter table emps modify column time_col set stats 
('row_count'='4');"""
+    sql """alter table emps modify column time_col set stats 
('row_count'='8');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from emps order by empid;", "emps_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testAggQuqeryOnAggMV7/testAggQuqeryOnAggMV7.groovy
 
b/regression-test/suites/mv_p0/ut/testAggQuqeryOnAggMV7/testAggQuqeryOnAggMV7.groovy
index 82e2c878956..bf2ed58a376 100644
--- 
a/regression-test/suites/mv_p0/ut/testAggQuqeryOnAggMV7/testAggQuqeryOnAggMV7.groovy
+++ 
b/regression-test/suites/mv_p0/ut/testAggQuqeryOnAggMV7/testAggQuqeryOnAggMV7.groovy
@@ -33,16 +33,19 @@ suite ("testAggQuqeryOnAggMV7") {
         """
 
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
+    sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
 
     createMV("create materialized view emps_mv as select deptno, commission, 
sum(salary) from emps group by deptno, commission;")
 
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
 
     sql """analyze table emps with sync;"""
-    sql """alter table emps modify column time_col set stats 
('row_count'='4');"""
-    sql """alter table emps modify column time_col set stats 
('row_count'='4');"""
+    sql """alter table emps modify column time_col set stats 
('row_count'='8');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from emps order by empid;", "emps_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testAggTableCountDistinctInBitmapType/testAggTableCountDistinctInBitmapType.groovy
 
b/regression-test/suites/mv_p0/ut/testAggTableCountDistinctInBitmapType/testAggTableCountDistinctInBitmapType.groovy
index 2af8c74566e..e68a207a324 100644
--- 
a/regression-test/suites/mv_p0/ut/testAggTableCountDistinctInBitmapType/testAggTableCountDistinctInBitmapType.groovy
+++ 
b/regression-test/suites/mv_p0/ut/testAggTableCountDistinctInBitmapType/testAggTableCountDistinctInBitmapType.groovy
@@ -25,12 +25,15 @@ suite ("testAggTableCountDistinctInBitmapType") {
         """
 
     sql """insert into test_tb values(1,to_bitmap(1));"""
+    sql """insert into test_tb values(1,to_bitmap(1));"""
+    sql """insert into test_tb values(2,to_bitmap(2));"""
     sql """insert into test_tb values(2,to_bitmap(2));"""
     sql """insert into test_tb values(3,to_bitmap(3));"""
+    sql """insert into test_tb values(3,to_bitmap(3));"""
 
 
     sql "analyze table test_tb with sync;"
-    sql """alter table test_tb modify column k1 set stats ('row_count'='3');"""
+    sql """alter table test_tb modify column k1 set stats ('row_count'='6');"""
     sql """set enable_stats=false;"""
 
     qt_select_star "select * from test_tb order by 1;"
diff --git 
a/regression-test/suites/mv_p0/ut/testAggregateMVCalcAggFunctionQuery/testAggregateMVCalcAggFunctionQuery.groovy
 
b/regression-test/suites/mv_p0/ut/testAggregateMVCalcAggFunctionQuery/testAggregateMVCalcAggFunctionQuery.groovy
index 9fdee877cd6..90308b50bad 100644
--- 
a/regression-test/suites/mv_p0/ut/testAggregateMVCalcAggFunctionQuery/testAggregateMVCalcAggFunctionQuery.groovy
+++ 
b/regression-test/suites/mv_p0/ut/testAggregateMVCalcAggFunctionQuery/testAggregateMVCalcAggFunctionQuery.groovy
@@ -32,16 +32,20 @@ suite ("testAggregateMVCalcAggFunctionQuery") {
         """
 
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
+    sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
 
 
     createMV("create materialized view emps_mv as select deptno, empid, 
sum(salary) from emps group by empid, deptno;")
 
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
 
     sql "analyze table emps with sync;"
-    sql """alter table emps modify column time_col set stats 
('row_count'='4');"""
+    sql """alter table emps modify column time_col set stats 
('row_count'='8');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from emps order by empid;", "emps_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testBitmapUnionInQuery/testBitmapUnionInQuery.groovy
 
b/regression-test/suites/mv_p0/ut/testBitmapUnionInQuery/testBitmapUnionInQuery.groovy
index ab6632ca487..ca427baad94 100644
--- 
a/regression-test/suites/mv_p0/ut/testBitmapUnionInQuery/testBitmapUnionInQuery.groovy
+++ 
b/regression-test/suites/mv_p0/ut/testBitmapUnionInQuery/testBitmapUnionInQuery.groovy
@@ -30,14 +30,17 @@ suite ("testBitmapUnionInQuery") {
         """
 
     sql """insert into user_tags values("2020-01-01",1,"a",1);"""
+    sql """insert into user_tags values("2020-01-01",1,"a",1);"""
+    sql """insert into user_tags values("2020-01-02",2,"b",2);"""
     sql """insert into user_tags values("2020-01-02",2,"b",2);"""
 
     createMV("create materialized view user_tags_mv as select user_id, 
bitmap_union(to_bitmap(tag_id)) from user_tags group by user_id;")
 
+    sql """insert into user_tags values("2020-01-01",1,"a",2);"""
     sql """insert into user_tags values("2020-01-01",1,"a",2);"""
 
     sql "analyze table user_tags with sync;"
-    sql """alter table user_tags modify column time_col set stats 
('row_count'='3');"""
+    sql """alter table user_tags modify column time_col set stats 
('row_count'='6');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from user_tags order by time_col;", 
"user_tags_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testCountDistinctToBitmap/testCountDistinctToBitmap.groovy
 
b/regression-test/suites/mv_p0/ut/testCountDistinctToBitmap/testCountDistinctToBitmap.groovy
index 4e1de1eedee..ed0b296ff0d 100644
--- 
a/regression-test/suites/mv_p0/ut/testCountDistinctToBitmap/testCountDistinctToBitmap.groovy
+++ 
b/regression-test/suites/mv_p0/ut/testCountDistinctToBitmap/testCountDistinctToBitmap.groovy
@@ -30,14 +30,17 @@ suite ("testCountDistinctToBitmap") {
         """
 
     sql """insert into user_tags values("2020-01-01",1,"a",1);"""
+    sql """insert into user_tags values("2020-01-01",1,"a",1);"""
+    sql """insert into user_tags values("2020-01-02",2,"b",2);"""
     sql """insert into user_tags values("2020-01-02",2,"b",2);"""
 
     createMV("create materialized view user_tags_mv as select user_id, 
bitmap_union(to_bitmap(tag_id)) from user_tags group by user_id;")
 
+    sql """insert into user_tags values("2020-01-01",1,"a",2);"""
     sql """insert into user_tags values("2020-01-01",1,"a",2);"""
 
     sql "analyze table user_tags with sync;"
-    sql """alter table user_tags modify column time_col set stats 
('row_count'='3');"""
+    sql """alter table user_tags modify column time_col set stats 
('row_count'='6');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from user_tags order by time_col;", 
"user_tags_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testIncorrectMVRewriteInSubquery/testIncorrectMVRewriteInSubquery.groovy
 
b/regression-test/suites/mv_p0/ut/testIncorrectMVRewriteInSubquery/testIncorrectMVRewriteInSubquery.groovy
index 4de20757ef8..07466312cfc 100644
--- 
a/regression-test/suites/mv_p0/ut/testIncorrectMVRewriteInSubquery/testIncorrectMVRewriteInSubquery.groovy
+++ 
b/regression-test/suites/mv_p0/ut/testIncorrectMVRewriteInSubquery/testIncorrectMVRewriteInSubquery.groovy
@@ -29,14 +29,17 @@ suite ("testIncorrectMVRewriteInSubquery") {
         """
 
     sql """insert into user_tags values("2020-01-01",1,"a",1);"""
+    sql """insert into user_tags values("2020-01-01",1,"a",1);"""
+    sql """insert into user_tags values("2020-01-02",2,"b",2);"""
     sql """insert into user_tags values("2020-01-02",2,"b",2);"""
 
     createMV("create materialized view user_tags_mv as select user_id, 
bitmap_union(to_bitmap(tag_id)) from user_tags group by user_id;")
 
+    sql """insert into user_tags values("2020-01-01",1,"a",2);"""
     sql """insert into user_tags values("2020-01-01",1,"a",2);"""
 
     sql "analyze table user_tags with sync;"
-    sql """alter table user_tags modify column time_col set stats 
('row_count'='3');"""
+    sql """alter table user_tags modify column time_col set stats 
('row_count'='6');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from user_tags order by time_col;", 
"user_tags_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testIncorrectRewriteCountDistinct/testIncorrectRewriteCountDistinct.groovy
 
b/regression-test/suites/mv_p0/ut/testIncorrectRewriteCountDistinct/testIncorrectRewriteCountDistinct.groovy
index dfd212a7fad..5f600dfc3a9 100644
--- 
a/regression-test/suites/mv_p0/ut/testIncorrectRewriteCountDistinct/testIncorrectRewriteCountDistinct.groovy
+++ 
b/regression-test/suites/mv_p0/ut/testIncorrectRewriteCountDistinct/testIncorrectRewriteCountDistinct.groovy
@@ -29,14 +29,17 @@ suite ("testIncorrectRewriteCountDistinct") {
         """
 
     sql """insert into user_tags values("2020-01-01",1,"a",1);"""
+    sql """insert into user_tags values("2020-01-01",1,"a",1);"""
+    sql """insert into user_tags values("2020-01-02",2,"b",2);"""
     sql """insert into user_tags values("2020-01-02",2,"b",2);"""
 
     createMV("create materialized view user_tags_mv as select user_id, 
bitmap_union(to_bitmap(tag_id)) from user_tags group by user_id;")
 
+    sql """insert into user_tags values("2020-01-01",1,"a",2);"""
     sql """insert into user_tags values("2020-01-01",1,"a",2);"""
 
     sql "analyze table user_tags with sync;"
-    sql """alter table user_tags modify column time_col set stats 
('row_count'='3');"""
+    sql """alter table user_tags modify column time_col set stats 
('row_count'='6');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from user_tags order by time_col;", 
"user_tags_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testJoinOnLeftProjectToJoin/testJoinOnLeftProjectToJoin.groovy
 
b/regression-test/suites/mv_p0/ut/testJoinOnLeftProjectToJoin/testJoinOnLeftProjectToJoin.groovy
index 6f609743842..f4b786c04aa 100644
--- 
a/regression-test/suites/mv_p0/ut/testJoinOnLeftProjectToJoin/testJoinOnLeftProjectToJoin.groovy
+++ 
b/regression-test/suites/mv_p0/ut/testJoinOnLeftProjectToJoin/testJoinOnLeftProjectToJoin.groovy
@@ -30,8 +30,11 @@ suite ("testJoinOnLeftProjectToJoin") {
         """
 
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
+    sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
     sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
     sql """insert into emps values("2020-01-02",2,"b",2,7,2);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,7,2);"""
 
     sql """ DROP TABLE IF EXISTS depts; """
     sql """
@@ -43,17 +46,20 @@ suite ("testJoinOnLeftProjectToJoin") {
         partition by range (time_col) (partition p1 values less than MAXVALUE) 
distributed by hash(time_col) buckets 3 properties('replication_num' = '1');
         """
 
-    sql """alter table depts modify column time_col set stats 
('row_count'='3');"""
+    sql """alter table depts modify column time_col set stats 
('row_count'='6');"""
 
     sql """insert into depts values("2020-01-02",2,"b",2);"""
+    sql """insert into depts values("2020-01-02",2,"b",2);"""
+    sql """insert into depts values("2020-01-03",3,"c",3);"""
     sql """insert into depts values("2020-01-03",3,"c",3);"""
     sql """insert into depts values("2020-01-02",2,"b",1);"""
+    sql """insert into depts values("2020-01-02",2,"b",1);"""
 
     createMV("create materialized view emps_mv as select deptno, sum(salary), 
sum(commission) from emps group by deptno;")
     createMV("create materialized view depts_mv as select deptno, max(cost) 
from depts group by deptno;")
 
     sql "analyze table emps with sync;"
-    sql """alter table emps modify column time_col set stats 
('row_count'='3');"""
+    sql """alter table emps modify column time_col set stats 
('row_count'='6');"""
 
     sql """set enable_stats=false;"""
 
diff --git a/regression-test/suites/mv_p0/ut/testNDVToHll/testNDVToHll.groovy 
b/regression-test/suites/mv_p0/ut/testNDVToHll/testNDVToHll.groovy
index 769d483544c..c02f4eb02eb 100644
--- a/regression-test/suites/mv_p0/ut/testNDVToHll/testNDVToHll.groovy
+++ b/regression-test/suites/mv_p0/ut/testNDVToHll/testNDVToHll.groovy
@@ -31,14 +31,17 @@ suite ("testNDVToHll") {
         """
 
     sql """insert into user_tags values("2020-01-01",1,"a",1);"""
+    sql """insert into user_tags values("2020-01-01",1,"a",1);"""
+    sql """insert into user_tags values("2020-01-02",2,"b",2);"""
     sql """insert into user_tags values("2020-01-02",2,"b",2);"""
 
     createMV("create materialized view user_tags_mv as select user_id, 
hll_union(hll_hash(tag_id)) from user_tags group by user_id;")
 
+    sql """insert into user_tags values("2020-01-01",1,"a",2);"""
     sql """insert into user_tags values("2020-01-01",1,"a",2);"""
 
     sql "analyze table user_tags with sync;"
-    sql """alter table user_tags modify column time_col set stats 
('row_count'='3');"""
+    sql """alter table user_tags modify column time_col set stats 
('row_count'='6');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from user_tags order by time_col;", 
"user_tags_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testOrderByQueryOnProjectView/testOrderByQueryOnProjectView.groovy
 
b/regression-test/suites/mv_p0/ut/testOrderByQueryOnProjectView/testOrderByQueryOnProjectView.groovy
index b5c11b3fbdb..5d78d91c95d 100644
--- 
a/regression-test/suites/mv_p0/ut/testOrderByQueryOnProjectView/testOrderByQueryOnProjectView.groovy
+++ 
b/regression-test/suites/mv_p0/ut/testOrderByQueryOnProjectView/testOrderByQueryOnProjectView.groovy
@@ -32,15 +32,19 @@ suite ("testOrderByQueryOnProjectView") {
         """
 
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
+    sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
 
     createMV("create materialized view emps_mv as select deptno, empid from 
emps;")
 
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
 
     sql "analyze table emps with sync;"
-    sql """alter table emps modify column time_col set stats 
('row_count'='4');"""
+    sql """alter table emps modify column time_col set stats 
('row_count'='8');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from emps order by empid;", "emps_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testProjectionMV1/testProjectionMV1.groovy 
b/regression-test/suites/mv_p0/ut/testProjectionMV1/testProjectionMV1.groovy
index dcc8245a45f..b78d251da6d 100644
--- a/regression-test/suites/mv_p0/ut/testProjectionMV1/testProjectionMV1.groovy
+++ b/regression-test/suites/mv_p0/ut/testProjectionMV1/testProjectionMV1.groovy
@@ -32,6 +32,8 @@ suite ("testProjectionMV1") {
         """
 
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
 
     test {
@@ -41,10 +43,11 @@ suite ("testProjectionMV1") {
 
     createMV("create materialized view emps_mv as select deptno, empid from 
emps order by deptno;")
 
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
 
     sql "analyze table emps with sync;"
-    sql """alter table emps modify column time_col set stats 
('row_count'='3');"""
+    sql """alter table emps modify column time_col set stats 
('row_count'='6');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from emps order by empid;", "emps_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testProjectionMV2/testProjectionMV2.groovy 
b/regression-test/suites/mv_p0/ut/testProjectionMV2/testProjectionMV2.groovy
index 8d65df35835..3af9fd26cc3 100644
--- a/regression-test/suites/mv_p0/ut/testProjectionMV2/testProjectionMV2.groovy
+++ b/regression-test/suites/mv_p0/ut/testProjectionMV2/testProjectionMV2.groovy
@@ -32,14 +32,17 @@ suite ("testProjectionMV2") {
         """
 
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
 
     createMV("create materialized view emps_mv as select deptno, empid from 
emps order by deptno;")
 
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
 
     sql "analyze table emps with sync;"
-    sql """alter table emps modify column time_col set stats 
('row_count'='3');"""
+    sql """alter table emps modify column time_col set stats 
('row_count'='6');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from emps order by empid;", "emps_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testProjectionMV3/testProjectionMV3.groovy 
b/regression-test/suites/mv_p0/ut/testProjectionMV3/testProjectionMV3.groovy
index 5c24070d9cc..8082eaa1352 100644
--- a/regression-test/suites/mv_p0/ut/testProjectionMV3/testProjectionMV3.groovy
+++ b/regression-test/suites/mv_p0/ut/testProjectionMV3/testProjectionMV3.groovy
@@ -32,16 +32,19 @@ suite ("testProjectionMV3") {
         """
 
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
 
     def result = "null"
 
     createMV("create materialized view emps_mv as select deptno, empid, name 
from emps order by deptno;")
 
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
 
     sql """analyze table emps with sync;"""
-    sql """alter table emps modify column time_col set stats 
('row_count'='3');"""
+    sql """alter table emps modify column time_col set stats 
('row_count'='6');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from emps order by empid;", "emps_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testProjectionMV4/testProjectionMV4.groovy 
b/regression-test/suites/mv_p0/ut/testProjectionMV4/testProjectionMV4.groovy
index 370f21b3d73..68c0505d83f 100644
--- a/regression-test/suites/mv_p0/ut/testProjectionMV4/testProjectionMV4.groovy
+++ b/regression-test/suites/mv_p0/ut/testProjectionMV4/testProjectionMV4.groovy
@@ -32,16 +32,19 @@ suite ("testProjectionMV4") {
         """
 
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
 
     def result = "null"
 
     createMV("create materialized view emps_mv as select name, deptno, salary 
from emps;")
 
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
 
     sql "analyze table emps with sync;"
-    sql """alter table emps modify column time_col set stats 
('row_count'='3');"""
+    sql """alter table emps modify column time_col set stats 
('row_count'='6');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from emps order by empid;", "emps_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testSingleMVMultiUsage/testSingleMVMultiUsage.groovy
 
b/regression-test/suites/mv_p0/ut/testSingleMVMultiUsage/testSingleMVMultiUsage.groovy
index 5da7c15b186..a2076a9a0b8 100644
--- 
a/regression-test/suites/mv_p0/ut/testSingleMVMultiUsage/testSingleMVMultiUsage.groovy
+++ 
b/regression-test/suites/mv_p0/ut/testSingleMVMultiUsage/testSingleMVMultiUsage.groovy
@@ -32,15 +32,19 @@ suite ("testSingleMVMultiUsage") {
         """
 
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
+    sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
 
     createMV("create materialized view emps_mv as select deptno, empid, salary 
from emps order by deptno;")
 
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
 
     sql "analyze table emps with sync;"
-    sql """alter table emps modify column time_col set stats 
('row_count'='4');"""
+    sql """alter table emps modify column time_col set stats 
('row_count'='8');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from emps order by empid;", "emps_mv")
diff --git a/regression-test/suites/mv_p0/ut/testSubQuery/testSubQuery.groovy 
b/regression-test/suites/mv_p0/ut/testSubQuery/testSubQuery.groovy
index 58100561862..6e40eec885c 100644
--- a/regression-test/suites/mv_p0/ut/testSubQuery/testSubQuery.groovy
+++ b/regression-test/suites/mv_p0/ut/testSubQuery/testSubQuery.groovy
@@ -35,15 +35,19 @@ suite ("testSubQuery") {
         """
 
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
+    sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
 
     createMV("create materialized view emps_mv as select deptno, empid from 
emps;")
 
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
 
     sql "analyze table emps with sync;"
-    sql """alter table emps modify column time_col set stats 
('row_count'='4');"""
+    sql """alter table emps modify column time_col set stats 
('row_count'='8');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from emps order by empid;", "emps_mv")
diff --git 
a/regression-test/suites/mv_p0/ut/testUnionDistinct/testUnionDistinct.groovy 
b/regression-test/suites/mv_p0/ut/testUnionDistinct/testUnionDistinct.groovy
index c6243a3f923..6b2ee26d221 100644
--- a/regression-test/suites/mv_p0/ut/testUnionDistinct/testUnionDistinct.groovy
+++ b/regression-test/suites/mv_p0/ut/testUnionDistinct/testUnionDistinct.groovy
@@ -32,15 +32,20 @@ suite ("testUnionDistinct") {
         """
 
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
+    sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
+    sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
 
 
     createMV("create materialized view emps_mv as select empid, deptno from 
emps order by empid, deptno;")
 
+    sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
 
     sql "analyze table emps with sync;"
+    sql """alter table emps modify column time_col set stats 
('row_count'='8');"""
     sql """set enable_stats=false;"""
 
     mv_rewrite_fail("select * from emps order by empid;", "emps_mv")
@@ -53,7 +58,6 @@ suite ("testUnionDistinct") {
     }
     qt_select_mv "select * from (select empid, deptno from emps where empid >1 
union select empid, deptno from emps where empid <0) t order by 1;"
     sql """set enable_stats=true;"""
-    sql """alter table emps modify column time_col set stats 
('row_count'='4');"""
     mv_rewrite_fail("select * from emps order by empid;", "emps_mv")
 
     explain {
diff --git 
a/regression-test/suites/nereids_rules_p0/mv/union_rewrite/usercase_union_rewrite.groovy
 
b/regression-test/suites/nereids_rules_p0/mv/union_rewrite/usercase_union_rewrite.groovy
index a90b7a98044..559a72a9208 100644
--- 
a/regression-test/suites/nereids_rules_p0/mv/union_rewrite/usercase_union_rewrite.groovy
+++ 
b/regression-test/suites/nereids_rules_p0/mv/union_rewrite/usercase_union_rewrite.groovy
@@ -106,7 +106,7 @@ suite ("usercase_union_rewrite") {
     sql """analyze table orders_user with sync;"""
     sql """analyze table lineitem_user with sync;"""
 
-    sql """alter table orders_user modify column o_comment set stats 
('row_count'='7');"""
+    sql """alter table orders_user modify column o_comment set stats 
('row_count'='21');"""
     sql """alter table lineitem_user modify column l_comment set stats 
('row_count'='3');"""
 
     def create_mv_orders = { mv_name, mv_sql ->


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to