From 7d7c37db03efc4fe7cd4323d527c6530c846e271 Mon Sep 17 00:00:00 2001 From: ChangerR Date: Fri, 10 Nov 2023 06:39:12 +0000 Subject: [PATCH] fix some bugs --- src/sql/optimizer/ob_log_plan.cpp | 2 + src/sql/optimizer/ob_optimizer.cpp | 9 + .../ob_transform_simplify_subquery.cpp | 5 +- .../r/mysql/subplan_filter.result | 549 +++++++++--------- 4 files changed, 275 insertions(+), 290 deletions(-) diff --git a/src/sql/optimizer/ob_log_plan.cpp b/src/sql/optimizer/ob_log_plan.cpp index cb32fc7fb..a5a449e1a 100644 --- a/src/sql/optimizer/ob_log_plan.cpp +++ b/src/sql/optimizer/ob_log_plan.cpp @@ -11981,6 +11981,8 @@ int ObLogPlan::choose_duplicate_table_replica(ObLogicalOperator *op, } else if (is_stack_overflow) { ret = OB_SIZE_OVERFLOW; LOG_WARN("too deep recursive", K(ret)); + } else if (log_op_def::LOG_TEMP_TABLE_INSERT == op->get_type()) { + // do nothing } else if (log_op_def::LOG_TABLE_SCAN == op->get_type() && NULL != op->get_strong_sharding() && op->get_strong_sharding()->get_can_reselect_replica() && diff --git a/src/sql/optimizer/ob_optimizer.cpp b/src/sql/optimizer/ob_optimizer.cpp index 15cfa3212..599208581 100644 --- a/src/sql/optimizer/ob_optimizer.cpp +++ b/src/sql/optimizer/ob_optimizer.cpp @@ -190,6 +190,7 @@ int ObOptimizer::generate_plan_for_temp_table(ObDMLStmt &stmt) ObSelectStmt *ref_query = NULL; ObSelectLogPlan *temp_plan = NULL; ObLogicalOperator *temp_op = NULL; + ObShardingInfo *sharding_info = NULL; for (int64_t i = 0; OB_SUCC(ret) && i < temp_table_infos.count(); i++) { ObRawExpr *temp_table_nonwhere_filter = NULL; ObRawExpr *temp_table_where_filter = NULL; @@ -224,10 +225,18 @@ int ObOptimizer::generate_plan_for_temp_table(ObDMLStmt &stmt) LOG_WARN("Failed to generate temp_plan for sub_stmt", K(ret)); } else if (OB_FAIL(temp_plan->get_candidate_plans().get_best_plan(temp_op))) { LOG_WARN("failed to get best plan", K(ret)); + } else if (OB_FAIL(temp_plan->choose_duplicate_table_replica(temp_op, + ctx_.get_local_server_addr(), + true))) { + LOG_WARN("failed to choose duplicate table replica", K(ret)); } else if (OB_ISNULL(temp_op)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("get unexpected null", K(ret)); } else { + sharding_info = temp_op->get_strong_sharding(); + if (NULL != sharding_info && sharding_info->get_can_reselect_replica()) { + sharding_info->set_can_reselect_replica(false); + } if (NULL != temp_table_nonwhere_filter) { ObSEArray expr_array; if (OB_FAIL(expr_array.push_back(temp_table_nonwhere_filter))) { diff --git a/src/sql/rewrite/ob_transform_simplify_subquery.cpp b/src/sql/rewrite/ob_transform_simplify_subquery.cpp index 286e106de..cb3a4c4be 100644 --- a/src/sql/rewrite/ob_transform_simplify_subquery.cpp +++ b/src/sql/rewrite/ob_transform_simplify_subquery.cpp @@ -1987,14 +1987,11 @@ int ObTransformSimplifySubquery::try_trans_any_all_as_exists(ObDMLStmt *stmt, } } else { //check children - bool child_is_bool_expr = expr->get_expr_type() == T_OP_OR || - expr->get_expr_type() == T_OP_AND || - expr->get_expr_type() == T_OP_XOR; for (int64_t i = 0; OB_SUCC(ret) && i < expr->get_param_count(); ++i) { if (OB_FAIL(SMART_CALL(try_trans_any_all_as_exists(stmt, expr->get_param_expr(i), not_null_ctx, - child_is_bool_expr, + false, is_happened)))) { LOG_WARN("failed to try_transform_any_all for param", K(ret)); } else { diff --git a/tools/deploy/mysql_test/test_suite/static_engine/r/mysql/subplan_filter.result b/tools/deploy/mysql_test/test_suite/static_engine/r/mysql/subplan_filter.result index 6e15d759f..92daa9337 100644 --- a/tools/deploy/mysql_test/test_suite/static_engine/r/mysql/subplan_filter.result +++ b/tools/deploy/mysql_test/test_suite/static_engine/r/mysql/subplan_filter.result @@ -2021,18 +2021,18 @@ Query Plan ================================================================== |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------------------------ -|0 |SUBPLAN FILTER | |18 |659 | +|0 |SUBPLAN FILTER | |18 |660 | |1 |├─PX COORDINATOR | |18 |14 | |2 |│ └─EXCHANGE OUT DISTR |:EX10000|18 |11 | |3 |│ └─PX PARTITION ITERATOR | |18 |5 | |4 |│ └─TABLE FULL SCAN |t1 |18 |5 | -|5 |├─TABLE GET |t2 |1 |18 | -|6 |└─DISTRIBUTED TABLE RANGE SCAN|t2 |1 |18 | +|5 |├─TABLE RANGE SCAN |t2 |8 |18 | +|6 |└─DISTRIBUTED TABLE RANGE SCAN|t2 |8 |18 | ================================================================== Outputs & filters: ------------------------------------- - 0 - output([t1.c1], [(T_OP_EXISTS, subquery(1)) AND (T_OP_EXISTS, subquery(2))]), filter(nil), rowset=256 - exec_params_([t1.c1(:0)], [t1.c1(:1)], [cast(t1.c1, DECIMAL_INT(10, 0))(:2)]), onetime_exprs_(nil), init_plan_idxs_(nil), use_batch=false + 0 - output([t1.c1], [t1.c1 = ANY(subquery(1)) AND cast(t1.c1, DECIMAL_INT(10, 0)) = ANY(subquery(2))]), filter(nil), rowset=256 + exec_params_([t1.c1(:0)], [t1.c1(:1)]), onetime_exprs_(nil), init_plan_idxs_(nil), use_batch=false 1 - output([t1.c1]), filter(nil), rowset=256 2 - output([t1.c1]), filter(nil), rowset=256 dop=1 @@ -2042,14 +2042,14 @@ Outputs & filters: access([t1.c1]), partitions(p[0-1]) is_index_back=false, is_global_index=false, range_key([t1.c1]), range(MIN ; MAX)always true - 5 - output([1]), filter(nil), rowset=256 - access(nil), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, + 5 - output([t2.c1]), filter(nil), rowset=256 + access([t2.c1]), partitions(p0) + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([t2.c1 >= :0], [t2.c1 = :0]) - 6 - output([1]), filter([t2.c2 = :2]), rowset=256 + range_cond([t2.c1 >= :0]) + 6 - output([t2.c2]), filter(nil), rowset=256 access([t2.c2]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, filter_before_indexback[false], + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, range_cond([t2.c1 >= :1]) Used Hint: @@ -2060,19 +2060,17 @@ Used Hint: Qb name trace: ------------------------------------- stmt_id:0, stmt_type:T_EXPLAIN - stmt_id:1, SEL$1 > SEL$4D615D57 > SEL$26211548 + stmt_id:1, SEL$1 stmt_id:2, SEL$2 stmt_id:3, SEL$3 Outline Data: ------------------------------------- /*+ BEGIN_OUTLINE_DATA - FULL(@"SEL$26211548" "test"."t1"@"SEL$1") + FULL(@"SEL$1" "test"."t1"@"SEL$1") FULL(@"SEL$2" "test"."t2"@"SEL$2") FULL(@"SEL$3" "t2"@"SEL$3") USE_DAS(@"SEL$3" "t2"@"SEL$3") - SIMPLIFY_SUBQUERY(@"SEL$1") - SIMPLIFY_SUBQUERY(@"SEL$4D615D57") OPTIMIZER_FEATURES_ENABLE('4.0.0.0') END_OUTLINE_DATA */ @@ -2091,21 +2089,21 @@ Optimization Info: dynamic sampling level:1 t2: table_rows:22 - physical_range_rows:1 - logical_range_rows:1 + physical_range_rows:7 + logical_range_rows:7 index_back_rows:0 - output_rows:1 + output_rows:7 table_dop:1 dop_method:Table DOP avaiable_index_name:[t2] stats version:0 - dynamic sampling level:0 + dynamic sampling level:1 t2: table_rows:22 physical_range_rows:7 logical_range_rows:7 index_back_rows:0 - output_rows:0 + output_rows:7 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t2] @@ -2143,18 +2141,18 @@ Query Plan ================================================================== |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------------------------ -|0 |SUBPLAN FILTER | |18 |659 | +|0 |SUBPLAN FILTER | |18 |660 | |1 |├─PX COORDINATOR | |18 |14 | |2 |│ └─EXCHANGE OUT DISTR |:EX10000|18 |11 | |3 |│ └─PX PARTITION ITERATOR | |18 |5 | |4 |│ └─TABLE FULL SCAN |t1 |18 |5 | -|5 |├─TABLE GET |t2 |1 |18 | -|6 |└─DISTRIBUTED TABLE RANGE SCAN|t2 |1 |18 | +|5 |├─TABLE RANGE SCAN |t2 |8 |18 | +|6 |└─DISTRIBUTED TABLE RANGE SCAN|t2 |8 |18 | ================================================================== Outputs & filters: ------------------------------------- - 0 - output([t1.c1], [(T_OP_EXISTS, subquery(1)) OR (T_OP_EXISTS, subquery(2))]), filter(nil), rowset=256 - exec_params_([t1.c1(:0)], [t1.c1(:1)], [cast(t1.c1, DECIMAL_INT(10, 0))(:2)]), onetime_exprs_(nil), init_plan_idxs_(nil), use_batch=false + 0 - output([t1.c1], [t1.c1 = ANY(subquery(1)) OR cast(t1.c1, DECIMAL_INT(10, 0)) = ANY(subquery(2))]), filter(nil), rowset=256 + exec_params_([t1.c1(:0)], [t1.c1(:1)]), onetime_exprs_(nil), init_plan_idxs_(nil), use_batch=false 1 - output([t1.c1]), filter(nil), rowset=256 2 - output([t1.c1]), filter(nil), rowset=256 dop=1 @@ -2164,14 +2162,14 @@ Outputs & filters: access([t1.c1]), partitions(p[0-1]) is_index_back=false, is_global_index=false, range_key([t1.c1]), range(MIN ; MAX)always true - 5 - output([1]), filter(nil), rowset=256 - access(nil), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, + 5 - output([t2.c1]), filter(nil), rowset=256 + access([t2.c1]), partitions(p0) + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([t2.c1 >= :0], [t2.c1 = :0]) - 6 - output([1]), filter([t2.c2 = :2]), rowset=256 + range_cond([t2.c1 >= :0]) + 6 - output([t2.c2]), filter(nil), rowset=256 access([t2.c2]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, filter_before_indexback[false], + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, range_cond([t2.c1 >= :1]) Used Hint: @@ -2182,19 +2180,17 @@ Used Hint: Qb name trace: ------------------------------------- stmt_id:0, stmt_type:T_EXPLAIN - stmt_id:1, SEL$1 > SEL$4D615D57 > SEL$26211548 + stmt_id:1, SEL$1 stmt_id:2, SEL$2 stmt_id:3, SEL$3 Outline Data: ------------------------------------- /*+ BEGIN_OUTLINE_DATA - FULL(@"SEL$26211548" "test"."t1"@"SEL$1") + FULL(@"SEL$1" "test"."t1"@"SEL$1") FULL(@"SEL$2" "test"."t2"@"SEL$2") FULL(@"SEL$3" "t2"@"SEL$3") USE_DAS(@"SEL$3" "t2"@"SEL$3") - SIMPLIFY_SUBQUERY(@"SEL$1") - SIMPLIFY_SUBQUERY(@"SEL$4D615D57") OPTIMIZER_FEATURES_ENABLE('4.0.0.0') END_OUTLINE_DATA */ @@ -2213,21 +2209,21 @@ Optimization Info: dynamic sampling level:1 t2: table_rows:22 - physical_range_rows:1 - logical_range_rows:1 + physical_range_rows:7 + logical_range_rows:7 index_back_rows:0 - output_rows:1 + output_rows:7 table_dop:1 dop_method:Table DOP avaiable_index_name:[t2] stats version:0 - dynamic sampling level:0 + dynamic sampling level:1 t2: table_rows:22 physical_range_rows:7 logical_range_rows:7 index_back_rows:0 - output_rows:0 + output_rows:7 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t2] @@ -2265,18 +2261,18 @@ Query Plan ================================================================== |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------------------------ -|0 |SUBPLAN FILTER | |18 |659 | +|0 |SUBPLAN FILTER | |18 |660 | |1 |├─PX COORDINATOR | |18 |14 | |2 |│ └─EXCHANGE OUT DISTR |:EX10000|18 |11 | |3 |│ └─PX PARTITION ITERATOR | |18 |5 | |4 |│ └─TABLE FULL SCAN |t1 |18 |5 | -|5 |├─TABLE GET |t2 |1 |18 | -|6 |└─DISTRIBUTED TABLE RANGE SCAN|t2 |1 |18 | +|5 |├─TABLE RANGE SCAN |t2 |8 |18 | +|6 |└─DISTRIBUTED TABLE RANGE SCAN|t2 |8 |18 | ================================================================== Outputs & filters: ------------------------------------- - 0 - output([t1.c1], [(T_OP_EXISTS, subquery(1)) AND (T_OP_EXISTS, subquery(2))]), filter(nil), rowset=256 - exec_params_([t1.c1(:0)], [t1.c1(:1)], [cast(t1.c1, DECIMAL_INT(10, 0))(:2)]), onetime_exprs_(nil), init_plan_idxs_(nil), use_batch=false + 0 - output([t1.c1], [t1.c1 = ANY(subquery(1)) AND cast(t1.c1, DECIMAL_INT(10, 0)) = ANY(subquery(2))]), filter(nil), rowset=256 + exec_params_([t1.c1(:0)], [t1.c1(:1)]), onetime_exprs_(nil), init_plan_idxs_(nil), use_batch=false 1 - output([t1.c1]), filter(nil), rowset=256 2 - output([t1.c1]), filter(nil), rowset=256 dop=1 @@ -2286,14 +2282,14 @@ Outputs & filters: access([t1.c1]), partitions(p[0-1]) is_index_back=false, is_global_index=false, range_key([t1.c1]), range(MIN ; MAX)always true - 5 - output([1]), filter(nil), rowset=256 - access(nil), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, + 5 - output([t2.c1]), filter(nil), rowset=256 + access([t2.c1]), partitions(p0) + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([t2.c1 = :0], [t2.c1 >= :0]) - 6 - output([1]), filter([t2.c2 = :2]), rowset=256 + range_cond([t2.c1 <= :0]) + 6 - output([t2.c2]), filter(nil), rowset=256 access([t2.c2]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, filter_before_indexback[false], + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, range_cond([t2.c1 <= :1]) Used Hint: @@ -2304,20 +2300,17 @@ Used Hint: Qb name trace: ------------------------------------- stmt_id:0, stmt_type:T_EXPLAIN - stmt_id:1, SEL$1 > SEL$4D615D57 > SEL$26211548 - stmt_id:2, SEL$2 > SEL$69480C90 + stmt_id:1, SEL$1 + stmt_id:2, SEL$2 stmt_id:3, SEL$3 Outline Data: ------------------------------------- /*+ BEGIN_OUTLINE_DATA - FULL(@"SEL$26211548" "test"."t1"@"SEL$1") - FULL(@"SEL$69480C90" "test"."t2"@"SEL$2") + FULL(@"SEL$1" "test"."t1"@"SEL$1") + FULL(@"SEL$2" "test"."t2"@"SEL$2") FULL(@"SEL$3" "t2"@"SEL$3") USE_DAS(@"SEL$3" "t2"@"SEL$3") - SIMPLIFY_SUBQUERY(@"SEL$1") - PRED_DEDUCE(@"SEL$2") - SIMPLIFY_SUBQUERY(@"SEL$4D615D57") OPTIMIZER_FEATURES_ENABLE('4.0.0.0') END_OUTLINE_DATA */ @@ -2336,21 +2329,21 @@ Optimization Info: dynamic sampling level:1 t2: table_rows:22 - physical_range_rows:1 - logical_range_rows:1 + physical_range_rows:7 + logical_range_rows:7 index_back_rows:0 - output_rows:1 + output_rows:7 table_dop:1 dop_method:Table DOP avaiable_index_name:[t2] stats version:0 - dynamic sampling level:0 + dynamic sampling level:1 t2: table_rows:22 physical_range_rows:7 logical_range_rows:7 index_back_rows:0 - output_rows:0 + output_rows:7 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t2] @@ -2388,18 +2381,18 @@ Query Plan ================================================================== |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------------------------ -|0 |SUBPLAN FILTER | |18 |659 | +|0 |SUBPLAN FILTER | |18 |660 | |1 |├─PX COORDINATOR | |18 |14 | |2 |│ └─EXCHANGE OUT DISTR |:EX10000|18 |11 | |3 |│ └─PX PARTITION ITERATOR | |18 |5 | |4 |│ └─TABLE FULL SCAN |t1 |18 |5 | -|5 |├─TABLE GET |t2 |1 |18 | -|6 |└─DISTRIBUTED TABLE RANGE SCAN|t2 |1 |18 | +|5 |├─TABLE RANGE SCAN |t2 |8 |18 | +|6 |└─DISTRIBUTED TABLE RANGE SCAN|t2 |8 |18 | ================================================================== Outputs & filters: ------------------------------------- - 0 - output([t1.c1], [(T_OP_EXISTS, subquery(1)) OR (T_OP_EXISTS, subquery(2))]), filter(nil), rowset=256 - exec_params_([t1.c1(:0)], [t1.c1(:1)], [cast(t1.c1, DECIMAL_INT(10, 0))(:2)]), onetime_exprs_(nil), init_plan_idxs_(nil), use_batch=false + 0 - output([t1.c1], [t1.c1 = ANY(subquery(1)) OR cast(t1.c1, DECIMAL_INT(10, 0)) = ANY(subquery(2))]), filter(nil), rowset=256 + exec_params_([t1.c1(:0)], [t1.c1(:1)]), onetime_exprs_(nil), init_plan_idxs_(nil), use_batch=false 1 - output([t1.c1]), filter(nil), rowset=256 2 - output([t1.c1]), filter(nil), rowset=256 dop=1 @@ -2409,14 +2402,14 @@ Outputs & filters: access([t1.c1]), partitions(p[0-1]) is_index_back=false, is_global_index=false, range_key([t1.c1]), range(MIN ; MAX)always true - 5 - output([1]), filter(nil), rowset=256 - access(nil), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, + 5 - output([t2.c1]), filter(nil), rowset=256 + access([t2.c1]), partitions(p0) + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([t2.c1 = :0], [t2.c1 >= :0]) - 6 - output([1]), filter([t2.c2 = :2]), rowset=256 + range_cond([t2.c1 <= :0]) + 6 - output([t2.c2]), filter(nil), rowset=256 access([t2.c2]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, filter_before_indexback[false], + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, range_cond([t2.c1 <= :1]) Used Hint: @@ -2427,20 +2420,17 @@ Used Hint: Qb name trace: ------------------------------------- stmt_id:0, stmt_type:T_EXPLAIN - stmt_id:1, SEL$1 > SEL$4D615D57 > SEL$26211548 - stmt_id:2, SEL$2 > SEL$69480C90 + stmt_id:1, SEL$1 + stmt_id:2, SEL$2 stmt_id:3, SEL$3 Outline Data: ------------------------------------- /*+ BEGIN_OUTLINE_DATA - FULL(@"SEL$26211548" "test"."t1"@"SEL$1") - FULL(@"SEL$69480C90" "test"."t2"@"SEL$2") + FULL(@"SEL$1" "test"."t1"@"SEL$1") + FULL(@"SEL$2" "test"."t2"@"SEL$2") FULL(@"SEL$3" "t2"@"SEL$3") USE_DAS(@"SEL$3" "t2"@"SEL$3") - SIMPLIFY_SUBQUERY(@"SEL$1") - PRED_DEDUCE(@"SEL$2") - SIMPLIFY_SUBQUERY(@"SEL$4D615D57") OPTIMIZER_FEATURES_ENABLE('4.0.0.0') END_OUTLINE_DATA */ @@ -2459,21 +2449,21 @@ Optimization Info: dynamic sampling level:1 t2: table_rows:22 - physical_range_rows:1 - logical_range_rows:1 + physical_range_rows:7 + logical_range_rows:7 index_back_rows:0 - output_rows:1 + output_rows:7 table_dop:1 dop_method:Table DOP avaiable_index_name:[t2] stats version:0 - dynamic sampling level:0 + dynamic sampling level:1 t2: table_rows:22 physical_range_rows:7 logical_range_rows:7 index_back_rows:0 - output_rows:0 + output_rows:7 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t2] @@ -2511,19 +2501,19 @@ Query Plan ================================================================== |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------------------------ -|0 |SUBPLAN FILTER | |18 |982 | +|0 |SUBPLAN FILTER | |18 |983 | |1 |├─PX COORDINATOR | |18 |14 | |2 |│ └─EXCHANGE OUT DISTR |:EX10000|18 |11 | |3 |│ └─PX PARTITION ITERATOR | |18 |5 | |4 |│ └─TABLE FULL SCAN |t1 |18 |5 | -|5 |├─TABLE GET |t2 |1 |18 | -|6 |├─DISTRIBUTED TABLE RANGE SCAN|t2 |1 |18 | +|5 |├─TABLE RANGE SCAN |t2 |8 |18 | +|6 |├─DISTRIBUTED TABLE RANGE SCAN|t2 |8 |18 | |7 |└─DISTRIBUTED TABLE GET |t2 |1 |18 | ================================================================== Outputs & filters: ------------------------------------- - 0 - output([t1.c1], [(T_OP_EXISTS, subquery(1)) AND (T_OP_EXISTS, subquery(2)) OR BOOL(t1.c1 + subquery(3))]), filter(nil), rowset=256 - exec_params_([t1.c1(:0)], [t1.c1(:1)], [cast(t1.c1, DECIMAL_INT(10, 0))(:2)], [t1.c1(:3)]), onetime_exprs_(nil), init_plan_idxs_(nil), use_batch=false + 0 - output([t1.c1], [t1.c1 = ANY(subquery(1)) AND cast(t1.c1, DECIMAL_INT(10, 0)) = ANY(subquery(2)) OR BOOL(t1.c1 + subquery(3))]), filter(nil), rowset=256 + exec_params_([t1.c1(:0)], [t1.c1(:1)], [t1.c1(:2)]), onetime_exprs_(nil), init_plan_idxs_(nil), use_batch=false 1 - output([t1.c1]), filter(nil), rowset=256 2 - output([t1.c1]), filter(nil), rowset=256 dop=1 @@ -2533,21 +2523,21 @@ Outputs & filters: access([t1.c1]), partitions(p[0-1]) is_index_back=false, is_global_index=false, range_key([t1.c1]), range(MIN ; MAX)always true - 5 - output([1]), filter(nil), rowset=256 - access(nil), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, + 5 - output([t2.c1]), filter(nil), rowset=256 + access([t2.c1]), partitions(p0) + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([t2.c1 = :0], [t2.c1 >= :0]) - 6 - output([1]), filter([t2.c2 = :2]), rowset=256 + range_cond([t2.c1 <= :0]) + 6 - output([t2.c2]), filter(nil), rowset=256 access([t2.c2]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, filter_before_indexback[false], + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, range_cond([t2.c1 <= :1]) 7 - output([t2.c1]), filter(nil), rowset=256 access([t2.c1]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([t2.c1 = :3]) + range_cond([t2.c1 = :2]) Used Hint: ------------------------------------- /*+ @@ -2556,23 +2546,20 @@ Used Hint: Qb name trace: ------------------------------------- stmt_id:0, stmt_type:T_EXPLAIN - stmt_id:1, SEL$1 > SEL$4D615D57 > SEL$26211548 - stmt_id:2, SEL$2 > SEL$69480C90 + stmt_id:1, SEL$1 + stmt_id:2, SEL$2 stmt_id:3, SEL$3 stmt_id:4, SEL$4 Outline Data: ------------------------------------- /*+ BEGIN_OUTLINE_DATA - FULL(@"SEL$26211548" "test"."t1"@"SEL$1") - FULL(@"SEL$69480C90" "test"."t2"@"SEL$2") + FULL(@"SEL$1" "test"."t1"@"SEL$1") + FULL(@"SEL$2" "test"."t2"@"SEL$2") FULL(@"SEL$3" "t2"@"SEL$3") USE_DAS(@"SEL$3" "t2"@"SEL$3") FULL(@"SEL$4" "t2"@"SEL$4") USE_DAS(@"SEL$4" "t2"@"SEL$4") - SIMPLIFY_SUBQUERY(@"SEL$1") - PRED_DEDUCE(@"SEL$2") - SIMPLIFY_SUBQUERY(@"SEL$4D615D57") OPTIMIZER_FEATURES_ENABLE('4.0.0.0') END_OUTLINE_DATA */ @@ -2591,21 +2578,21 @@ Optimization Info: dynamic sampling level:1 t2: table_rows:22 - physical_range_rows:1 - logical_range_rows:1 + physical_range_rows:7 + logical_range_rows:7 index_back_rows:0 - output_rows:1 + output_rows:7 table_dop:1 dop_method:Table DOP avaiable_index_name:[t2] stats version:0 - dynamic sampling level:0 + dynamic sampling level:1 t2: table_rows:22 physical_range_rows:7 logical_range_rows:7 index_back_rows:0 - output_rows:0 + output_rows:7 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t2] @@ -2655,46 +2642,46 @@ Query Plan ====================================================================== |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ---------------------------------------------------------------------- -|0 |PX COORDINATOR | |18 |2272 | -|1 |└─EXCHANGE OUT DISTR |:EX10000|18 |2270 | -|2 | └─SUBPLAN FILTER | |18 |2263 | +|0 |PX COORDINATOR | |18 |2273 | +|1 |└─EXCHANGE OUT DISTR |:EX10000|18 |2271 | +|2 | └─SUBPLAN FILTER | |18 |2264 | |3 | ├─PX PARTITION ITERATOR | |18 |5 | |4 | │ └─TABLE FULL SCAN |t1 |18 |5 | |5 | ├─DISTRIBUTED TABLE GET |t2 |1 |18 | -|6 | ├─DISTRIBUTED TABLE GET |t2 |1 |18 | +|6 | ├─DISTRIBUTED TABLE RANGE SCAN|t2 |8 |18 | |7 | ├─DISTRIBUTED TABLE GET |t2 |1 |18 | |8 | ├─DISTRIBUTED TABLE GET |t2 |1 |18 | -|9 | ├─DISTRIBUTED TABLE RANGE SCAN|t2 |1 |18 | +|9 | ├─DISTRIBUTED TABLE RANGE SCAN|t2 |8 |18 | |10| ├─DISTRIBUTED TABLE GET |t2 |1 |18 | -|11| └─DISTRIBUTED TABLE GET |t2 |1 |18 | +|11| └─DISTRIBUTED TABLE RANGE SCAN|t2 |8 |18 | ====================================================================== Outputs & filters: ------------------------------------- - 0 - output([INTERNAL_FUNCTION(t1.c1, (T_OP_EXISTS, subquery(1)) AND (T_OP_EXISTS, subquery(2)) OR BOOL(t1.c1 + subquery(3)), BOOL(t1.c1 + subquery(4)) - OR (T_OP_EXISTS, subquery(5)), cast(t1.c1, DECIMAL_INT(12, 0)) + subquery(6) > cast(10, DECIMAL_INT(12, 0)) AND (T_OP_EXISTS, subquery(7)))]), filter(nil), rowset=256 - 1 - output([INTERNAL_FUNCTION(t1.c1, (T_OP_EXISTS, subquery(1)) AND (T_OP_EXISTS, subquery(2)) OR BOOL(t1.c1 + subquery(3)), BOOL(t1.c1 + subquery(4)) - OR (T_OP_EXISTS, subquery(5)), cast(t1.c1, DECIMAL_INT(12, 0)) + subquery(6) > cast(10, DECIMAL_INT(12, 0)) AND (T_OP_EXISTS, subquery(7)))]), filter(nil), rowset=256 + 0 - output([INTERNAL_FUNCTION(t1.c1, t1.c1 = ANY(subquery(1)) AND t1.c1 = ANY(subquery(2)) OR BOOL(t1.c1 + subquery(3)), BOOL(t1.c1 + subquery(4)) OR + cast(t1.c1, DECIMAL_INT(10, 0)) = ANY(subquery(5)), cast(t1.c1, DECIMAL_INT(12, 0)) + subquery(6) > cast(10, DECIMAL_INT(12, 0)) AND t1.c1 = ANY(subquery(7)))]), filter(nil), rowset=256 + 1 - output([INTERNAL_FUNCTION(t1.c1, t1.c1 = ANY(subquery(1)) AND t1.c1 = ANY(subquery(2)) OR BOOL(t1.c1 + subquery(3)), BOOL(t1.c1 + subquery(4)) OR + cast(t1.c1, DECIMAL_INT(10, 0)) = ANY(subquery(5)), cast(t1.c1, DECIMAL_INT(12, 0)) + subquery(6) > cast(10, DECIMAL_INT(12, 0)) AND t1.c1 = ANY(subquery(7)))]), filter(nil), rowset=256 dop=1 - 2 - output([t1.c1], [(T_OP_EXISTS, subquery(1))], [(T_OP_EXISTS, subquery(2))], [(T_OP_EXISTS, subquery(5))], [(T_OP_EXISTS, subquery(7))], [subquery(3)], - [subquery(4)], [subquery(6)]), filter(nil), rowset=256 - exec_params_([t1.c1(:0)], [t1.c1(:1)], [t1.c1(:2)], [t1.c1(:3)], [t1.c1(:4)], [cast(t1.c1, DECIMAL_INT(10, 0))(:5)], [t1.c1(:6)], [t1.c1(:7)]), onetime_exprs_(nil), - init_plan_idxs_(nil), use_batch=true + 2 - output([t1.c1], [t1.c1 = ANY(subquery(1))], [t1.c1 = ANY(subquery(2))], [cast(t1.c1, DECIMAL_INT(10, 0)) = ANY(subquery(5))], [t1.c1 = ANY(subquery(7))], + [subquery(3)], [subquery(4)], [subquery(6)]), filter(nil), rowset=256 + exec_params_([t1.c1(:0)], [t1.c1(:1)], [t1.c1(:2)], [t1.c1(:3)], [t1.c1(:4)], [t1.c1(:5)], [t1.c1(:6)]), onetime_exprs_(nil), init_plan_idxs_(nil), + use_batch=true 3 - output([t1.c1]), filter(nil), rowset=256 force partition granule 4 - output([t1.c1]), filter(nil), rowset=256 access([t1.c1]), partitions(p[0-1]) is_index_back=false, is_global_index=false, range_key([t1.c1]), range(MIN ; MAX)always true - 5 - output([1]), filter(nil), rowset=256 - access([GROUP_ID]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, + 5 - output([t2.c1]), filter(nil), rowset=256 + access([GROUP_ID], [t2.c1]), partitions(p0) + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, range_cond([t2.c1 = :0]) - 6 - output([1]), filter(nil), rowset=256 - access([GROUP_ID]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, + 6 - output([t2.c1]), filter(nil), rowset=256 + access([GROUP_ID], [t2.c1]), partitions(p0) + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([t2.c1 = :1], [t2.c1 >= :1]) + range_cond([t2.c1 <= :1]) 7 - output([t2.c1]), filter(nil), rowset=256 access([GROUP_ID], [t2.c1]), partitions(p0) is_index_back=false, is_global_index=false, @@ -2705,21 +2692,21 @@ Outputs & filters: is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, range_cond([t2.c1 = :3]) - 9 - output([1]), filter([t2.c2 = :5]), rowset=256 + 9 - output([t2.c2]), filter(nil), rowset=256 access([GROUP_ID], [t2.c2]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, filter_before_indexback[false], + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, range_cond([t2.c1 <= :4]) 10 - output([t2.c2]), filter(nil), rowset=256 access([GROUP_ID], [t2.c2]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([:6 = t2.c1]) - 11 - output([1]), filter(nil), rowset=256 - access([GROUP_ID]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, + range_cond([:5 = t2.c1]) + 11 - output([t2.c1]), filter(nil), rowset=256 + access([GROUP_ID], [t2.c1]), partitions(p0) + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([:7 >= t2.c1], [t2.c1 = :7]) + range_cond([:6 >= t2.c1]) Used Hint: ------------------------------------- /*+ @@ -2728,9 +2715,9 @@ Used Hint: Qb name trace: ------------------------------------- stmt_id:0, stmt_type:T_EXPLAIN - stmt_id:1, SEL$1 > SEL$4D615D57 > SEL$26211548 - stmt_id:2, SEL$2 > SEL$69480C90 - stmt_id:3, SEL$3 > SEL$DD143F72 + stmt_id:1, SEL$1 + stmt_id:2, SEL$2 + stmt_id:3, SEL$3 stmt_id:4, SEL$4 stmt_id:5, SEL$5 stmt_id:6, SEL$6 @@ -2740,11 +2727,11 @@ Outline Data: ------------------------------------- /*+ BEGIN_OUTLINE_DATA - FULL(@"SEL$26211548" "test"."t1"@"SEL$1") - FULL(@"SEL$69480C90" "test"."t2"@"SEL$2") - USE_DAS(@"SEL$69480C90" "test"."t2"@"SEL$2") - FULL(@"SEL$DD143F72" "t2"@"SEL$3") - USE_DAS(@"SEL$DD143F72" "t2"@"SEL$3") + FULL(@"SEL$1" "test"."t1"@"SEL$1") + FULL(@"SEL$2" "test"."t2"@"SEL$2") + USE_DAS(@"SEL$2" "test"."t2"@"SEL$2") + FULL(@"SEL$3" "t2"@"SEL$3") + USE_DAS(@"SEL$3" "t2"@"SEL$3") FULL(@"SEL$4" "t2"@"SEL$4") USE_DAS(@"SEL$4" "t2"@"SEL$4") FULL(@"SEL$5" "t2"@"SEL$5") @@ -2755,10 +2742,6 @@ Outline Data: USE_DAS(@"SEL$7" "t2"@"SEL$7") FULL(@"SEL$8" "t2"@"SEL$8") USE_DAS(@"SEL$8" "t2"@"SEL$8") - SIMPLIFY_SUBQUERY(@"SEL$1") - PRED_DEDUCE(@"SEL$2") - PRED_DEDUCE(@"SEL$3") - SIMPLIFY_SUBQUERY(@"SEL$4D615D57") OPTIMIZER_FEATURES_ENABLE('4.0.0.0') END_OUTLINE_DATA */ @@ -2786,45 +2769,12 @@ Optimization Info: avaiable_index_name:[t2] stats version:0 dynamic sampling level:0 - t2: - table_rows:22 - physical_range_rows:1 - logical_range_rows:1 - index_back_rows:0 - output_rows:1 - table_dop:1 - dop_method:DAS DOP - avaiable_index_name:[t2] - stats version:0 - dynamic sampling level:0 - t2: - table_rows:22 - physical_range_rows:1 - logical_range_rows:1 - index_back_rows:0 - output_rows:1 - table_dop:1 - dop_method:DAS DOP - avaiable_index_name:[t2] - stats version:0 - dynamic sampling level:0 - t2: - table_rows:22 - physical_range_rows:1 - logical_range_rows:1 - index_back_rows:0 - output_rows:1 - table_dop:1 - dop_method:DAS DOP - avaiable_index_name:[t2] - stats version:0 - dynamic sampling level:0 t2: table_rows:22 physical_range_rows:7 logical_range_rows:7 index_back_rows:0 - output_rows:0 + output_rows:7 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t2] @@ -2852,6 +2802,39 @@ Optimization Info: avaiable_index_name:[t2] stats version:0 dynamic sampling level:0 + t2: + table_rows:22 + physical_range_rows:7 + logical_range_rows:7 + index_back_rows:0 + output_rows:7 + table_dop:1 + dop_method:DAS DOP + avaiable_index_name:[t2] + stats version:0 + dynamic sampling level:1 + t2: + table_rows:22 + physical_range_rows:1 + logical_range_rows:1 + index_back_rows:0 + output_rows:1 + table_dop:1 + dop_method:DAS DOP + avaiable_index_name:[t2] + stats version:0 + dynamic sampling level:0 + t2: + table_rows:22 + physical_range_rows:7 + logical_range_rows:7 + index_back_rows:0 + output_rows:7 + table_dop:1 + dop_method:DAS DOP + avaiable_index_name:[t2] + stats version:0 + dynamic sampling level:1 Plan Type: DISTRIBUTED Note: @@ -2885,46 +2868,46 @@ Query Plan ====================================================================== |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ---------------------------------------------------------------------- -|0 |PX COORDINATOR | |18 |2272 | -|1 |└─EXCHANGE OUT DISTR |:EX10000|18 |2270 | -|2 | └─SUBPLAN FILTER | |18 |2263 | +|0 |PX COORDINATOR | |18 |2274 | +|1 |└─EXCHANGE OUT DISTR |:EX10000|18 |2271 | +|2 | └─SUBPLAN FILTER | |18 |2265 | |3 | ├─PX PARTITION ITERATOR | |18 |5 | |4 | │ └─TABLE FULL SCAN |t1 |18 |5 | -|5 | ├─DISTRIBUTED TABLE GET |t2 |1 |18 | -|6 | ├─DISTRIBUTED TABLE GET |t2 |1 |18 | +|5 | ├─DISTRIBUTED TABLE RANGE SCAN|t2 |8 |18 | +|6 | ├─DISTRIBUTED TABLE RANGE SCAN|t2 |8 |18 | |7 | ├─DISTRIBUTED TABLE GET |t2 |1 |18 | |8 | ├─DISTRIBUTED TABLE GET |t2 |1 |18 | -|9 | ├─DISTRIBUTED TABLE RANGE SCAN|t2 |1 |18 | +|9 | ├─DISTRIBUTED TABLE RANGE SCAN|t2 |8 |18 | |10| ├─DISTRIBUTED TABLE GET |t2 |1 |18 | -|11| └─DISTRIBUTED TABLE GET |t2 |1 |18 | +|11| └─DISTRIBUTED TABLE RANGE SCAN|t2 |8 |18 | ====================================================================== Outputs & filters: ------------------------------------- - 0 - output([INTERNAL_FUNCTION(t1.c1, (T_OP_EXISTS, subquery(1)) AND (T_OP_EXISTS, subquery(2)) OR BOOL(t1.c1 + subquery(3)), t1.c1 + subquery(4) > 30 - OR (T_OP_EXISTS, subquery(5)), cast(t1.c1, DECIMAL_INT(12, 0)) + subquery(6) > cast(10, DECIMAL_INT(12, 0)) AND (T_OP_EXISTS, subquery(7)))]), filter(nil), rowset=256 - 1 - output([INTERNAL_FUNCTION(t1.c1, (T_OP_EXISTS, subquery(1)) AND (T_OP_EXISTS, subquery(2)) OR BOOL(t1.c1 + subquery(3)), t1.c1 + subquery(4) > 30 - OR (T_OP_EXISTS, subquery(5)), cast(t1.c1, DECIMAL_INT(12, 0)) + subquery(6) > cast(10, DECIMAL_INT(12, 0)) AND (T_OP_EXISTS, subquery(7)))]), filter(nil), rowset=256 + 0 - output([INTERNAL_FUNCTION(t1.c1, t1.c1 = ANY(subquery(1)) AND t1.c1 = ANY(subquery(2)) OR BOOL(t1.c1 + subquery(3)), t1.c1 + subquery(4) > 30 OR cast(t1.c1, + DECIMAL_INT(10, 0)) = ANY(subquery(5)), cast(t1.c1, DECIMAL_INT(12, 0)) + subquery(6) > cast(10, DECIMAL_INT(12, 0)) AND t1.c1 = ANY(subquery(7)))]), filter(nil), rowset=256 + 1 - output([INTERNAL_FUNCTION(t1.c1, t1.c1 = ANY(subquery(1)) AND t1.c1 = ANY(subquery(2)) OR BOOL(t1.c1 + subquery(3)), t1.c1 + subquery(4) > 30 OR cast(t1.c1, + DECIMAL_INT(10, 0)) = ANY(subquery(5)), cast(t1.c1, DECIMAL_INT(12, 0)) + subquery(6) > cast(10, DECIMAL_INT(12, 0)) AND t1.c1 = ANY(subquery(7)))]), filter(nil), rowset=256 dop=1 - 2 - output([t1.c1], [(T_OP_EXISTS, subquery(1))], [(T_OP_EXISTS, subquery(2))], [(T_OP_EXISTS, subquery(5))], [(T_OP_EXISTS, subquery(7))], [subquery(3)], - [subquery(4)], [subquery(6)]), filter(nil), rowset=256 - exec_params_([t1.c1(:0)], [t1.c1(:1)], [t1.c1(:2)], [t1.c1(:3)], [t1.c1(:4)], [cast(t1.c1, DECIMAL_INT(10, 0))(:5)], [t1.c1(:6)], [t1.c1(:7)]), onetime_exprs_(nil), - init_plan_idxs_(nil), use_batch=true + 2 - output([t1.c1], [t1.c1 = ANY(subquery(1))], [t1.c1 = ANY(subquery(2))], [cast(t1.c1, DECIMAL_INT(10, 0)) = ANY(subquery(5))], [t1.c1 = ANY(subquery(7))], + [subquery(3)], [subquery(4)], [subquery(6)]), filter(nil), rowset=256 + exec_params_([t1.c1(:0)], [t1.c1(:1)], [t1.c1(:2)], [t1.c1(:3)], [t1.c1(:4)], [t1.c1(:5)], [t1.c1(:6)]), onetime_exprs_(nil), init_plan_idxs_(nil), + use_batch=true 3 - output([t1.c1]), filter(nil), rowset=256 force partition granule 4 - output([t1.c1]), filter(nil), rowset=256 access([t1.c1]), partitions(p[0-1]) is_index_back=false, is_global_index=false, range_key([t1.c1]), range(MIN ; MAX)always true - 5 - output([1]), filter(nil), rowset=256 - access([GROUP_ID]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, + 5 - output([t2.c1]), filter(nil), rowset=256 + access([GROUP_ID], [t2.c1]), partitions(p0) + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([t2.c1 >= :0], [t2.c1 = :0]) - 6 - output([1]), filter(nil), rowset=256 - access([GROUP_ID]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, + range_cond([t2.c1 >= :0]) + 6 - output([t2.c1]), filter(nil), rowset=256 + access([GROUP_ID], [t2.c1]), partitions(p0) + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([t2.c1 = :1], [t2.c1 >= :1]) + range_cond([t2.c1 <= :1]) 7 - output([t2.c1]), filter(nil), rowset=256 access([GROUP_ID], [t2.c1]), partitions(p0) is_index_back=false, is_global_index=false, @@ -2935,21 +2918,21 @@ Outputs & filters: is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, range_cond([t2.c1 = :3]) - 9 - output([1]), filter([t2.c2 = :5]), rowset=256 + 9 - output([t2.c2]), filter(nil), rowset=256 access([GROUP_ID], [t2.c2]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, filter_before_indexback[false], + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, range_cond([t2.c1 <= :4]) 10 - output([t2.c2]), filter(nil), rowset=256 access([GROUP_ID], [t2.c2]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([:6 = t2.c1]) - 11 - output([1]), filter(nil), rowset=256 - access([GROUP_ID]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, + range_cond([:5 = t2.c1]) + 11 - output([t2.c1]), filter(nil), rowset=256 + access([GROUP_ID], [t2.c1]), partitions(p0) + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([:7 >= t2.c1], [t2.c1 = :7]) + range_cond([:6 >= t2.c1]) Used Hint: ------------------------------------- /*+ @@ -2958,9 +2941,9 @@ Used Hint: Qb name trace: ------------------------------------- stmt_id:0, stmt_type:T_EXPLAIN - stmt_id:1, SEL$1 > SEL$4D615D57 > SEL$26211548 + stmt_id:1, SEL$1 stmt_id:2, SEL$2 - stmt_id:3, SEL$3 > SEL$69480C90 + stmt_id:3, SEL$3 stmt_id:4, SEL$4 stmt_id:5, SEL$5 stmt_id:6, SEL$6 @@ -2970,11 +2953,11 @@ Outline Data: ------------------------------------- /*+ BEGIN_OUTLINE_DATA - FULL(@"SEL$26211548" "test"."t1"@"SEL$1") + FULL(@"SEL$1" "test"."t1"@"SEL$1") FULL(@"SEL$2" "test"."t2"@"SEL$2") USE_DAS(@"SEL$2" "test"."t2"@"SEL$2") - FULL(@"SEL$69480C90" "t2"@"SEL$3") - USE_DAS(@"SEL$69480C90" "t2"@"SEL$3") + FULL(@"SEL$3" "t2"@"SEL$3") + USE_DAS(@"SEL$3" "t2"@"SEL$3") FULL(@"SEL$4" "t2"@"SEL$4") USE_DAS(@"SEL$4" "t2"@"SEL$4") FULL(@"SEL$5" "t2"@"SEL$5") @@ -2985,9 +2968,6 @@ Outline Data: USE_DAS(@"SEL$7" "t2"@"SEL$7") FULL(@"SEL$8" "t2"@"SEL$8") USE_DAS(@"SEL$8" "t2"@"SEL$8") - SIMPLIFY_SUBQUERY(@"SEL$1") - PRED_DEDUCE(@"SEL$3") - SIMPLIFY_SUBQUERY(@"SEL$4D615D57") OPTIMIZER_FEATURES_ENABLE('4.0.0.0') END_OUTLINE_DATA */ @@ -3006,26 +2986,26 @@ Optimization Info: dynamic sampling level:1 t2: table_rows:22 - physical_range_rows:1 - logical_range_rows:1 + physical_range_rows:7 + logical_range_rows:7 index_back_rows:0 - output_rows:1 + output_rows:7 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t2] stats version:0 - dynamic sampling level:0 + dynamic sampling level:1 t2: table_rows:22 - physical_range_rows:1 - logical_range_rows:1 + physical_range_rows:7 + logical_range_rows:7 index_back_rows:0 - output_rows:1 + output_rows:7 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t2] stats version:0 - dynamic sampling level:0 + dynamic sampling level:1 t2: table_rows:22 physical_range_rows:1 @@ -3053,7 +3033,7 @@ Optimization Info: physical_range_rows:7 logical_range_rows:7 index_back_rows:0 - output_rows:0 + output_rows:7 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t2] @@ -3072,15 +3052,15 @@ Optimization Info: dynamic sampling level:0 t2: table_rows:22 - physical_range_rows:1 - logical_range_rows:1 + physical_range_rows:7 + logical_range_rows:7 index_back_rows:0 - output_rows:1 + output_rows:7 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t2] stats version:0 - dynamic sampling level:0 + dynamic sampling level:1 Plan Type: DISTRIBUTED Note: @@ -3114,46 +3094,46 @@ Query Plan ====================================================================== |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ---------------------------------------------------------------------- -|0 |PX COORDINATOR | |18 |2272 | -|1 |└─EXCHANGE OUT DISTR |:EX10000|18 |2270 | -|2 | └─SUBPLAN FILTER | |18 |2263 | +|0 |PX COORDINATOR | |18 |2274 | +|1 |└─EXCHANGE OUT DISTR |:EX10000|18 |2271 | +|2 | └─SUBPLAN FILTER | |18 |2265 | |3 | ├─PX PARTITION ITERATOR | |18 |5 | |4 | │ └─TABLE FULL SCAN |t1 |18 |5 | -|5 | ├─DISTRIBUTED TABLE GET |t2 |1 |18 | -|6 | ├─DISTRIBUTED TABLE GET |t2 |1 |18 | +|5 | ├─DISTRIBUTED TABLE RANGE SCAN|t2 |8 |18 | +|6 | ├─DISTRIBUTED TABLE RANGE SCAN|t2 |8 |18 | |7 | ├─DISTRIBUTED TABLE GET |t2 |1 |18 | |8 | ├─DISTRIBUTED TABLE GET |t2 |1 |18 | -|9 | ├─DISTRIBUTED TABLE RANGE SCAN|t2 |1 |18 | +|9 | ├─DISTRIBUTED TABLE RANGE SCAN|t2 |8 |18 | |10| ├─DISTRIBUTED TABLE GET |t2 |1 |18 | -|11| └─DISTRIBUTED TABLE GET |t2 |1 |18 | +|11| └─DISTRIBUTED TABLE RANGE SCAN|t2 |8 |18 | ====================================================================== Outputs & filters: ------------------------------------- - 0 - output([INTERNAL_FUNCTION(t1.c1, (T_OP_EXISTS, subquery(1)) AND (T_OP_EXISTS, subquery(2)) OR BOOL(t1.c1 + subquery(3)), t1.c1 + subquery(4) > 30 - OR (T_OP_EXISTS, subquery(5)), cast(t1.c1, DECIMAL_INT(12, 0)) + subquery(6) > cast(10, DECIMAL_INT(12, 0)) AND (T_OP_EXISTS, subquery(7)))]), filter(nil), rowset=256 - 1 - output([INTERNAL_FUNCTION(t1.c1, (T_OP_EXISTS, subquery(1)) AND (T_OP_EXISTS, subquery(2)) OR BOOL(t1.c1 + subquery(3)), t1.c1 + subquery(4) > 30 - OR (T_OP_EXISTS, subquery(5)), cast(t1.c1, DECIMAL_INT(12, 0)) + subquery(6) > cast(10, DECIMAL_INT(12, 0)) AND (T_OP_EXISTS, subquery(7)))]), filter(nil), rowset=256 + 0 - output([INTERNAL_FUNCTION(t1.c1, t1.c1 = ANY(subquery(1)) AND t1.c1 = ANY(subquery(2)) OR BOOL(t1.c1 + subquery(3)), t1.c1 + subquery(4) > 30 OR cast(t1.c1, + DECIMAL_INT(10, 0)) = ANY(subquery(5)), cast(t1.c1, DECIMAL_INT(12, 0)) + subquery(6) > cast(10, DECIMAL_INT(12, 0)) AND t1.c1 = ANY(subquery(7)))]), filter(nil), rowset=256 + 1 - output([INTERNAL_FUNCTION(t1.c1, t1.c1 = ANY(subquery(1)) AND t1.c1 = ANY(subquery(2)) OR BOOL(t1.c1 + subquery(3)), t1.c1 + subquery(4) > 30 OR cast(t1.c1, + DECIMAL_INT(10, 0)) = ANY(subquery(5)), cast(t1.c1, DECIMAL_INT(12, 0)) + subquery(6) > cast(10, DECIMAL_INT(12, 0)) AND t1.c1 = ANY(subquery(7)))]), filter(nil), rowset=256 dop=1 - 2 - output([t1.c1], [(T_OP_EXISTS, subquery(1))], [(T_OP_EXISTS, subquery(2))], [(T_OP_EXISTS, subquery(5))], [(T_OP_EXISTS, subquery(7))], [subquery(3)], - [subquery(4)], [subquery(6)]), filter(nil), rowset=256 - exec_params_([t1.c1(:0)], [t1.c1(:1)], [t1.c1(:2)], [t1.c1(:3)], [t1.c1(:4)], [cast(t1.c1, DECIMAL_INT(10, 0))(:5)], [t1.c1(:6)], [t1.c1(:7)]), onetime_exprs_(nil), - init_plan_idxs_(nil), use_batch=true + 2 - output([t1.c1], [t1.c1 = ANY(subquery(1))], [t1.c1 = ANY(subquery(2))], [cast(t1.c1, DECIMAL_INT(10, 0)) = ANY(subquery(5))], [t1.c1 = ANY(subquery(7))], + [subquery(3)], [subquery(4)], [subquery(6)]), filter(nil), rowset=256 + exec_params_([t1.c1(:0)], [t1.c1(:1)], [t1.c1(:2)], [t1.c1(:3)], [t1.c1(:4)], [t1.c1(:5)], [t1.c1(:6)]), onetime_exprs_(nil), init_plan_idxs_(nil), + use_batch=true 3 - output([t1.c1]), filter(nil), rowset=256 force partition granule 4 - output([t1.c1]), filter(nil), rowset=256 access([t1.c1]), partitions(p[0-1]) is_index_back=false, is_global_index=false, range_key([t1.c1]), range(MIN ; MAX)always true - 5 - output([1]), filter(nil), rowset=256 - access([GROUP_ID]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, + 5 - output([t2.c1]), filter(nil), rowset=256 + access([GROUP_ID], [t2.c1]), partitions(p0) + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([t2.c1 >= :0], [t2.c1 = :0]) - 6 - output([1]), filter(nil), rowset=256 - access([GROUP_ID]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, + range_cond([t2.c1 >= :0]) + 6 - output([t2.c1]), filter(nil), rowset=256 + access([GROUP_ID], [t2.c1]), partitions(p0) + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([t2.c1 = :1], [t2.c1 >= :1]) + range_cond([t2.c1 <= :1]) 7 - output([t2.c1]), filter(nil), rowset=256 access([GROUP_ID], [t2.c1]), partitions(p0) is_index_back=false, is_global_index=false, @@ -3164,21 +3144,21 @@ Outputs & filters: is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, range_cond([t2.c1 = :3]) - 9 - output([1]), filter([t2.c2 = :5]), rowset=256 + 9 - output([t2.c2]), filter(nil), rowset=256 access([GROUP_ID], [t2.c2]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, filter_before_indexback[false], + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, range_cond([t2.c1 <= :4]) 10 - output([t2.c2]), filter(nil), rowset=256 access([GROUP_ID], [t2.c2]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([:6 = t2.c1]) - 11 - output([1]), filter(nil), rowset=256 - access([GROUP_ID]), partitions(p0) - limit(1), offset(nil), is_index_back=false, is_global_index=false, + range_cond([:5 = t2.c1]) + 11 - output([t2.c1]), filter(nil), rowset=256 + access([GROUP_ID], [t2.c1]), partitions(p0) + is_index_back=false, is_global_index=false, range_key([t2.c1]), range(MIN ; MAX)always true, - range_cond([:7 >= t2.c1], [t2.c1 = :7]) + range_cond([:6 >= t2.c1]) Used Hint: ------------------------------------- /*+ @@ -3187,9 +3167,9 @@ Used Hint: Qb name trace: ------------------------------------- stmt_id:0, stmt_type:T_EXPLAIN - stmt_id:1, SEL$1 > SEL$4D615D57 > SEL$26211548 + stmt_id:1, SEL$1 stmt_id:2, SEL$2 - stmt_id:3, SEL$3 > SEL$69480C90 + stmt_id:3, SEL$3 stmt_id:4, SEL$4 stmt_id:5, SEL$5 stmt_id:6, SEL$6 @@ -3199,11 +3179,11 @@ Outline Data: ------------------------------------- /*+ BEGIN_OUTLINE_DATA - FULL(@"SEL$26211548" "test"."t1"@"SEL$1") + FULL(@"SEL$1" "test"."t1"@"SEL$1") FULL(@"SEL$2" "test"."t2"@"SEL$2") USE_DAS(@"SEL$2" "test"."t2"@"SEL$2") - FULL(@"SEL$69480C90" "t2"@"SEL$3") - USE_DAS(@"SEL$69480C90" "t2"@"SEL$3") + FULL(@"SEL$3" "t2"@"SEL$3") + USE_DAS(@"SEL$3" "t2"@"SEL$3") FULL(@"SEL$4" "t2"@"SEL$4") USE_DAS(@"SEL$4" "t2"@"SEL$4") FULL(@"SEL$5" "t2"@"SEL$5") @@ -3214,9 +3194,6 @@ Outline Data: USE_DAS(@"SEL$7" "t2"@"SEL$7") FULL(@"SEL$8" "t2"@"SEL$8") USE_DAS(@"SEL$8" "t2"@"SEL$8") - SIMPLIFY_SUBQUERY(@"SEL$1") - PRED_DEDUCE(@"SEL$3") - SIMPLIFY_SUBQUERY(@"SEL$4D615D57") OPTIMIZER_FEATURES_ENABLE('4.0.0.0') END_OUTLINE_DATA */ @@ -3235,26 +3212,26 @@ Optimization Info: dynamic sampling level:1 t2: table_rows:22 - physical_range_rows:1 - logical_range_rows:1 + physical_range_rows:7 + logical_range_rows:7 index_back_rows:0 - output_rows:1 + output_rows:7 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t2] stats version:0 - dynamic sampling level:0 + dynamic sampling level:1 t2: table_rows:22 - physical_range_rows:1 - logical_range_rows:1 + physical_range_rows:7 + logical_range_rows:7 index_back_rows:0 - output_rows:1 + output_rows:7 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t2] stats version:0 - dynamic sampling level:0 + dynamic sampling level:1 t2: table_rows:22 physical_range_rows:1 @@ -3282,7 +3259,7 @@ Optimization Info: physical_range_rows:7 logical_range_rows:7 index_back_rows:0 - output_rows:0 + output_rows:7 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t2] @@ -3301,15 +3278,15 @@ Optimization Info: dynamic sampling level:0 t2: table_rows:22 - physical_range_rows:1 - logical_range_rows:1 + physical_range_rows:7 + logical_range_rows:7 index_back_rows:0 - output_rows:1 + output_rows:7 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t2] stats version:0 - dynamic sampling level:0 + dynamic sampling level:1 Plan Type: DISTRIBUTED Note: