diff --git a/test/sql/test_materialized_view_rewrite/R/test_mv_rewrite_with_time_series_multi_mvs b/test/sql/test_materialized_view_rewrite/R/test_mv_rewrite_with_time_series_multi_mvs index dd6f7014b29d9..a632fd140d853 100644 --- a/test/sql/test_materialized_view_rewrite/R/test_mv_rewrite_with_time_series_multi_mvs +++ b/test/sql/test_materialized_view_rewrite/R/test_mv_rewrite_with_time_series_multi_mvs @@ -51,6 +51,18 @@ from t0 group by date_trunc('month', ts); -- result: -- !result refresh materialized view test_mv3 with sync mode; +[UC]analyze table test_mv1 WITH SYNC MODE; +-- result: +test_db_8d93f2d33c72496aa3925e2bb2c40af3.test_mv1 analyze status OK +-- !result +[UC]analyze table test_mv2 WITH SYNC MODE; +-- result: +test_db_8d93f2d33c72496aa3925e2bb2c40af3.test_mv2 analyze status OK +-- !result +[UC]analyze table test_mv3 WITH SYNC MODE; +-- result: +test_db_8d93f2d33c72496aa3925e2bb2c40af3.test_mv3 analyze status OK +-- !result set enable_materialized_view_rewrite=true; -- result: -- !result @@ -164,6 +176,18 @@ from test_mv2 group by date_trunc('month', dt); -- result: -- !result refresh materialized view test_mv3 with sync mode; +[UC]analyze table test_mv1 WITH SYNC MODE; +-- result: +test_db_8d93f2d33c72496aa3925e2bb2c40af3.test_mv1 analyze status OK +-- !result +[UC]analyze table test_mv2 WITH SYNC MODE; +-- result: +test_db_8d93f2d33c72496aa3925e2bb2c40af3.test_mv2 analyze status OK +-- !result +[UC]analyze table test_mv3 WITH SYNC MODE; +-- result: +test_db_8d93f2d33c72496aa3925e2bb2c40af3.test_mv3 analyze status OK +-- !result function: print_hit_materialized_views("select sum(v1), sum(v2) from t0 where ts > '2020-02-23 12:12:00' order by 1;") -- result: test_mv1,test_mv2,test_mv3 diff --git a/test/sql/test_materialized_view_rewrite/T/test_mv_rewrite_with_time_series_multi_mvs b/test/sql/test_materialized_view_rewrite/T/test_mv_rewrite_with_time_series_multi_mvs index 29bc150446e34..7eb8bf8ec3851 100644 --- a/test/sql/test_materialized_view_rewrite/T/test_mv_rewrite_with_time_series_multi_mvs +++ b/test/sql/test_materialized_view_rewrite/T/test_mv_rewrite_with_time_series_multi_mvs @@ -47,6 +47,11 @@ PROPERTIES ( from t0 group by date_trunc('month', ts); refresh materialized view test_mv3 with sync mode; +-- analyze mvs to make this case more stable +[UC]analyze table test_mv1 WITH SYNC MODE; +[UC]analyze table test_mv2 WITH SYNC MODE; +[UC]analyze table test_mv3 WITH SYNC MODE; + set enable_materialized_view_rewrite=true; function: print_hit_materialized_views("select sum(v1), sum(v2) from t0 where ts > '2020-02-23 12:12:00' order by 1;") @@ -98,6 +103,11 @@ from test_mv2 group by date_trunc('month', dt); refresh materialized view test_mv3 with sync mode; +-- analyze mvs to make this case more stable +[UC]analyze table test_mv1 WITH SYNC MODE; +[UC]analyze table test_mv2 WITH SYNC MODE; +[UC]analyze table test_mv3 WITH SYNC MODE; + function: print_hit_materialized_views("select sum(v1), sum(v2) from t0 where ts > '2020-02-23 12:12:00' order by 1;") function: print_hit_materialized_views("select sum(v1), sum(v2) from t0 where ts >= '2020-03-23 12:12:00' order by 1;") function: print_hit_materialized_views("select sum(v1), sum(v2) from t0 where ts < '2020-04-23 12:12:00' order by 1;")