From a4da2002c4307de125225df51b024ad3a7b730bb Mon Sep 17 00:00:00 2001 From: obdev Date: Thu, 13 Apr 2023 08:08:16 +0000 Subject: [PATCH] fix farm res due to adjustion of newsort open policy --- src/sql/optimizer/ob_optimizer_util.cpp | 5 +- tools/deploy/init_for_ce.sql | 1 + .../join/r/mysql/anti_semi_join.result | 62 +++++++++---------- 3 files changed, 36 insertions(+), 32 deletions(-) diff --git a/src/sql/optimizer/ob_optimizer_util.cpp b/src/sql/optimizer/ob_optimizer_util.cpp index 1d1fd15abd..ad3f7844c3 100644 --- a/src/sql/optimizer/ob_optimizer_util.cpp +++ b/src/sql/optimizer/ob_optimizer_util.cpp @@ -8096,6 +8096,7 @@ int ObOptimizerUtil::check_can_encode_sortkey(const common::ObIArray double avg_len = 0; bool has_hint = false; can_sort_opt = true; + bool old_can_opt = false; const ObOptParamHint opt_params = plan.get_optimizer_context().get_global_hint().opt_params_; if (OB_FAIL(opt_params.has_opt_param(ObOptParamHint::ENABLE_NEWSORT, has_hint))) { LOG_WARN("failed to check whether has hint param", K(ret)); @@ -8115,7 +8116,9 @@ int ObOptimizerUtil::check_can_encode_sortkey(const common::ObIArray LOG_WARN("failed to add sort key expr", K(ret)); } else { /* do nothing */ } } + old_can_opt = can_sort_opt; + // add width / row size policy, EN_ENABLE_NEWSORT_FORCE tracepoint will skip it if (OB_FAIL(ret)) { // do nothing } else if (!can_sort_opt) { @@ -8138,7 +8141,7 @@ int ObOptimizerUtil::check_can_encode_sortkey(const common::ObIArray int tmp_ret = OB_SUCCESS; tmp_ret = OB_E(EventTable::EN_ENABLE_NEWSORT_FORCE) OB_SUCCESS; if (OB_SUCCESS != tmp_ret) { - can_sort_opt = true; + can_sort_opt = old_can_opt; } } return ret; diff --git a/tools/deploy/init_for_ce.sql b/tools/deploy/init_for_ce.sql index 2f22a469d4..14d8b42a70 100644 --- a/tools/deploy/init_for_ce.sql +++ b/tools/deploy/init_for_ce.sql @@ -28,3 +28,4 @@ alter system set ob_compaction_schedule_interval = '10s' tenant all; alter system set merger_check_interval = '10s' tenant all; alter system set enable_sql_extension=true tenant all; alter system set _enable_adaptive_compaction = false tenant all; +alter system set_tp tp_no = 1200, error_code = 4001, frequency = 1; diff --git a/tools/deploy/mysql_test/test_suite/join/r/mysql/anti_semi_join.result b/tools/deploy/mysql_test/test_suite/join/r/mysql/anti_semi_join.result index 5ad901080f..2f833ec90c 100644 --- a/tools/deploy/mysql_test/test_suite/join/r/mysql/anti_semi_join.result +++ b/tools/deploy/mysql_test/test_suite/join/r/mysql/anti_semi_join.result @@ -708,14 +708,14 @@ select /*+use_merge(xy_x_t xy_y_t)*/ * from xy_x_t where x1 in (select y1 from x +------+------------+ | 0 | yzh | | 2 | think | -| 2 | want | | 2 | VZLUW | +| 2 | want | | 2 | it's | -| 6 | uyslpcybda | | 6 | u | -| 9 | TBMEI | +| 6 | uyslpcybda | | 9 | QPPLC | | 9 | mdsl | +| 9 | TBMEI | +------+------------+ EXPLAIN select /*+use_nl(xy_x_t xy_y_t)*/ * from xy_x_t where x1 in (select y1 from xy_y_t where y2 < xy_x_t.x2); Query Plan @@ -904,29 +904,29 @@ select /*+use_merge(xy_x_t xy_y_t)*/ * from xy_x_t where x1 not in (select y1 fr | 1 | TQOYB | | 1 | FFHTJ | | 2 | ezcuilyxac | -| 3 | prsazev | | 3 | get | +| 3 | prsazev | | 3 | out | -| 4 | a | | 4 | PVYPZ | | 4 | k | | 4 | bpqswbeyqj | | 4 | isjn | | 4 | that's | | 4 | well | -| 5 | PFBCU | -| 5 | just | +| 4 | a | | 5 | with | -| 5 | arkyz | | 5 | w | +| 5 | arkyz | +| 5 | just | +| 5 | PFBCU | | 6 | co | | 6 | j | | 6 | g | | 7 | cybdark | | 7 | BKWPE | +| 8 | lmdsl | | 8 | NNIGT | | 8 | of | -| 8 | lmdsl | | 9 | etu | | 27262976 | n | | 162267136 | to | @@ -1314,10 +1314,6 @@ select /*+ use_merge(xy_t1 xy_t2)*/ * from xy_t1 where exists (select 1 from xy_ | 3 | 3 | | 3 | 3 | | 3 | 3 | -| 5 | 7 | -| 5 | 7 | -| 5 | 5 | -| 5 | 5 | | 5 | 5 | | 5 | 5 | | 5 | 5 | @@ -1326,9 +1322,12 @@ select /*+ use_merge(xy_t1 xy_t2)*/ * from xy_t1 where exists (select 1 from xy_ | 5 | 5 | | 5 | 5 | | 5 | 7 | +| 5 | 5 | +| 5 | 5 | +| 5 | 7 | +| 5 | 7 | | 6 | NULL | | 6 | 7 | -| 6 | NULL | | 6 | 6 | | 6 | 7 | | 6 | 6 | @@ -1336,16 +1335,17 @@ select /*+ use_merge(xy_t1 xy_t2)*/ * from xy_t1 where exists (select 1 from xy_ | 6 | 7 | | 6 | 6 | | 6 | NULL | -| 6 | 6 | | 6 | 7 | +| 6 | 6 | +| 6 | NULL | | 9 | 7 | | 9 | 0 | -| 9 | 0 | -| 9 | 7 | | 9 | 7 | | 9 | 0 | +| 9 | 7 | | 9 | 0 | | 9 | 7 | +| 9 | 0 | +------+------+ EXPLAIN select /*+ no_rewrite */ * from xy_t1 where exists (select 1 from xy_t2 where xy_t2.c1 = xy_t1.c1); Query Plan @@ -2155,33 +2155,33 @@ select /*+ use_merge(xy_t1 xy_t2)*/ * from xy_t1 where not exists (select 1 from | 0 | 0 | | 0 | 0 | | 2 | NULL | -| 2 | NULL | -| 2 | 2 | | 2 | 2 | | 2 | 2 | | 2 | 2 | | 2 | NULL | +| 2 | 2 | +| 2 | NULL | | 2 | NULL | -| 7 | 7 | -| 7 | 0 | -| 7 | 7 | -| 7 | 7 | | 7 | 0 | | 7 | 0 | | 7 | 7 | | 7 | 0 | -| 8 | 5 | -| 8 | 5 | -| 8 | 5 | +| 7 | 7 | +| 7 | 0 | +| 7 | 7 | +| 7 | 7 | | 8 | 8 | -| 8 | 0 | -| 8 | 0 | -| 8 | 0 | | 8 | 5 | -| 8 | 8 | -| 8 | 8 | | 8 | 0 | | 8 | 8 | +| 8 | 5 | +| 8 | 0 | +| 8 | 8 | +| 8 | 5 | +| 8 | 0 | +| 8 | 8 | +| 8 | 5 | +| 8 | 0 | | 10 | 10 | | 10 | 10 | | 10 | 10 |