diff options
author | Vitalii Gridnev <gridnevvvit@gmail.com> | 2025-02-28 14:44:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-28 11:44:23 +0000 |
commit | 6964fca4eb4581d6a3055934614c20a54d094657 (patch) | |
tree | f0d3989e669720bb4f8e1bca611976831996c42f | |
parent | 3de66fa1720cd18a4937b1f2c164c098e9c5a04d (diff) | |
download | ydb-6964fca4eb4581d6a3055934614c20a54d094657.tar.gz |
remove ability to disable iterator lookups in functional tests (#15184)
94 files changed, 2910 insertions, 3410 deletions
diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_dynumber_insert_from_table.sql-plan_/dynumber_insert_from_table.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_dynumber_insert_from_table.sql-plan_/dynumber_insert_from_table.sql.plan index 73567045c8..c1ec7180d9 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_dynumber_insert_from_table.sql-plan_/dynumber_insert_from_table.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_dynumber_insert_from_table.sql-plan_/dynumber_insert_from_table.sql.plan @@ -23,6 +23,9 @@ "name": "/local/base_dynumber_insert_from_table_sql_plan/ResultTableDyNumber", "reads": [ { + "lookup_by": [ + "Key" + ], "type": "Lookup" } ], diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_dynumber_insert_literal.sql-plan_/dynumber_insert_literal.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_dynumber_insert_literal.sql-plan_/dynumber_insert_literal.sql.plan index 563e72065e..2360a2fc1b 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_dynumber_insert_literal.sql-plan_/dynumber_insert_literal.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_dynumber_insert_literal.sql-plan_/dynumber_insert_literal.sql.plan @@ -8,6 +8,9 @@ "name": "/local/base_dynumber_insert_literal_sql_plan/ResultLiteralDyNumber", "reads": [ { + "lookup_by": [ + "Key" + ], "type": "Lookup" } ], diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_dynumber_insert_params.sql-plan_/dynumber_insert_params.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_dynumber_insert_params.sql-plan_/dynumber_insert_params.sql.plan index 00465a5cfc..7fdad89607 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_dynumber_insert_params.sql-plan_/dynumber_insert_params.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_dynumber_insert_params.sql-plan_/dynumber_insert_params.sql.plan @@ -8,6 +8,9 @@ "name": "/local/base_dynumber_insert_params_sql_plan/ResultParamsDyNumber", "reads": [ { + "lookup_by": [ + "Key" + ], "type": "Lookup" } ], diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_predicate_point.sql-plan_/index_predicate_point.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_predicate_point.sql-plan_/index_predicate_point.sql.plan index 1142baae10..7a5223c658 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_predicate_point.sql-plan_/index_predicate_point.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_predicate_point.sql-plan_/index_predicate_point.sql.plan @@ -14,6 +14,10 @@ "Key2", "Value" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_select_using_index.sql-plan_/index_select_using_index.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_select_using_index.sql-plan_/index_select_using_index.sql.plan index f365bec80d..135eb38ef8 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_select_using_index.sql-plan_/index_select_using_index.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_select_using_index.sql-plan_/index_select_using_index.sql.plan @@ -14,6 +14,10 @@ "Key2", "Value" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_on_top_of_apply.sql-plan_/index_topsort_index_on_top_of_apply.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_on_top_of_apply.sql-plan_/index_topsort_index_on_top_of_apply.sql.plan index 3efad802f7..f44d7f0e29 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_on_top_of_apply.sql-plan_/index_topsort_index_on_top_of_apply.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_on_top_of_apply.sql-plan_/index_topsort_index_on_top_of_apply.sql.plan @@ -13,6 +13,9 @@ "Index1B", "Value" ], + "lookup_by": [ + "Key1" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_aliases_and_apply.sql-plan_/index_topsort_index_with_aliases_and_apply.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_aliases_and_apply.sql-plan_/index_topsort_index_with_aliases_and_apply.sql.plan index 14e25faf96..4bde38bd38 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_aliases_and_apply.sql-plan_/index_topsort_index_with_aliases_and_apply.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_aliases_and_apply.sql-plan_/index_topsort_index_with_aliases_and_apply.sql.plan @@ -13,6 +13,9 @@ "Index1B", "Value" ], + "lookup_by": [ + "Key1" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_nonselector_aliases.sql-plan_/index_topsort_index_with_nonselector_aliases.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_nonselector_aliases.sql-plan_/index_topsort_index_with_nonselector_aliases.sql.plan index 5a1eb9c14a..ef98578080 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_nonselector_aliases.sql-plan_/index_topsort_index_with_nonselector_aliases.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_nonselector_aliases.sql-plan_/index_topsort_index_with_nonselector_aliases.sql.plan @@ -13,6 +13,9 @@ "Index1B", "Value" ], + "lookup_by": [ + "Key1" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_selector_aliases.sql-plan_/index_topsort_index_with_selector_aliases.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_selector_aliases.sql-plan_/index_topsort_index_with_selector_aliases.sql.plan index a185d5fc1c..a1a5fa20d9 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_selector_aliases.sql-plan_/index_topsort_index_with_selector_aliases.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_selector_aliases.sql-plan_/index_topsort_index_with_selector_aliases.sql.plan @@ -13,6 +13,9 @@ "Index1B", "Value" ], + "lookup_by": [ + "Key1" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_group_by_lookup.script-script_/join_group_by_lookup.script.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_group_by_lookup.script-script_/join_group_by_lookup.script.plan index 2138e55a23..916955225b 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_group_by_lookup.script-script_/join_group_by_lookup.script.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_group_by_lookup.script-script_/join_group_by_lookup.script.plan @@ -10,8 +10,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 21, + "Node Type": "ResultSet_1", + "PlanNodeId": 18, "PlanNodeType": "ResultSet", "Plans": [ { @@ -20,22 +20,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 19 + "ExternalPlanNodeId": 16 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 20, + "PlanNodeId": 17, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 19, + "PlanNodeId": 16, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "TopSort-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "TopSort-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -51,86 +52,91 @@ "Condition": "a.Group = t.Group", "Inputs": [ { - "ExternalPlanNodeId": 17 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 15 + "ExternalPlanNodeId": 14 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 17, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 16 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 15, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 14, + "PlanNodeId": 13, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TablePointLookup-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 10 } ], "Name": "Filter", "Predicate": "Exist(item.Group)" - }, + } + ], + "PlanNodeId": 11, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } - ], - "Name": "TablePointLookup", - "Path": "/local/base_join_group_by_lookup_script_script/Temp", - "ReadColumns": [ + "Columns": [ "Group", "Value" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "Group" + ], + "Node Type": "TableLookup", + "Path": "/local/base_join_group_by_lookup_script_script/Temp", + "PlanNodeId": 10, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 9 + } + ], "Table": "base_join_group_by_lookup_script_script/Temp" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 12, - "Tables": [ - "base_join_group_by_lookup_script_script/Temp" ] } ] @@ -153,27 +159,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 10, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 9 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 7, @@ -294,6 +279,9 @@ "Group", "Value" ], + "lookup_by": [ + "Group" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_double_lookup.sql-plan_/join_join_double_lookup.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_double_lookup.sql-plan_/join_join_double_lookup.sql.plan index 5f581d2bb8..d71e6dd8c9 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_double_lookup.sql-plan_/join_join_double_lookup.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_double_lookup.sql-plan_/join_join_double_lookup.sql.plan @@ -26,7 +26,10 @@ "Key1", "Key2" ], - "type": "Scan" + "lookup_by": [ + "Key1" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_dup_column_right.sql-plan_/join_join_dup_column_right.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_dup_column_right.sql-plan_/join_join_dup_column_right.sql.plan index 353e0e719d..156ba5e195 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_dup_column_right.sql-plan_/join_join_dup_column_right.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_dup_column_right.sql-plan_/join_join_dup_column_right.sql.plan @@ -28,7 +28,10 @@ "Key1", "Key2" ], - "type": "Scan" + "lookup_by": [ + "Key1" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_range_right.sql-plan_/join_join_range_right.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_range_right.sql-plan_/join_join_range_right.sql.plan index ab27c6a2d4..5598346a8a 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_range_right.sql-plan_/join_join_range_right.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_range_right.sql-plan_/join_join_range_right.sql.plan @@ -29,6 +29,10 @@ "Key2", "Value" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup.sql-plan_/join_join_to_idx_lookup.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup.sql-plan_/join_join_to_idx_lookup.sql.plan index fb8adb1aff..78e3aa37f4 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup.sql-plan_/join_join_to_idx_lookup.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup.sql-plan_/join_join_to_idx_lookup.sql.plan @@ -29,6 +29,10 @@ "Key1", "Key2" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] @@ -41,6 +45,9 @@ "Key", "Value" ], + "lookup_by": [ + "Key" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_cast.sql-plan_/join_join_to_idx_lookup_cast.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_cast.sql-plan_/join_join_to_idx_lookup_cast.sql.plan index c4b1449d35..07dbd52ab1 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_cast.sql-plan_/join_join_to_idx_lookup_cast.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_cast.sql-plan_/join_join_to_idx_lookup_cast.sql.plan @@ -13,6 +13,10 @@ "Key2", "Value" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_cast2.sql-plan_/join_join_to_idx_lookup_cast2.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_cast2.sql-plan_/join_join_to_idx_lookup_cast2.sql.plan index fa88c7811f..a2a25f54ab 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_cast2.sql-plan_/join_join_to_idx_lookup_cast2.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_cast2.sql-plan_/join_join_to_idx_lookup_cast2.sql.plan @@ -30,7 +30,10 @@ "Key2", "Value" ], - "type": "Scan" + "lookup_by": [ + "Key1" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_dup_c_left.sql-plan_/join_join_to_idx_lookup_dup_c_left.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_dup_c_left.sql-plan_/join_join_to_idx_lookup_dup_c_left.sql.plan index 72375bfab2..191c472eaa 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_dup_c_left.sql-plan_/join_join_to_idx_lookup_dup_c_left.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_dup_c_left.sql-plan_/join_join_to_idx_lookup_dup_c_left.sql.plan @@ -28,6 +28,10 @@ "Key2", "Value" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_equi.sql-plan_/join_join_to_idx_lookup_equi.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_equi.sql-plan_/join_join_to_idx_lookup_equi.sql.plan index 58663c896e..abbd2fdae1 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_equi.sql-plan_/join_join_to_idx_lookup_equi.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_equi.sql-plan_/join_join_to_idx_lookup_equi.sql.plan @@ -31,6 +31,10 @@ "Key2", "Value" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_inner.sql-plan_/join_join_to_idx_lookup_inner.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_inner.sql-plan_/join_join_to_idx_lookup_inner.sql.plan index 9425366fa0..7504dfff41 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_inner.sql-plan_/join_join_to_idx_lookup_inner.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_inner.sql-plan_/join_join_to_idx_lookup_inner.sql.plan @@ -29,6 +29,10 @@ "Key1", "Key2" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] @@ -41,6 +45,9 @@ "Key", "Value" ], + "lookup_by": [ + "Key" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_leftonly.sql-plan_/join_join_to_idx_lookup_leftonly.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_leftonly.sql-plan_/join_join_to_idx_lookup_leftonly.sql.plan index e3cd0cc87d..664b99a71d 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_leftonly.sql-plan_/join_join_to_idx_lookup_leftonly.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_leftonly.sql-plan_/join_join_to_idx_lookup_leftonly.sql.plan @@ -27,6 +27,9 @@ "columns": [ "Key" ], + "lookup_by": [ + "Key" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_leftsemi.sql-plan_/join_join_to_idx_lookup_leftsemi.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_leftsemi.sql-plan_/join_join_to_idx_lookup_leftsemi.sql.plan index af8b7b3f2b..7077a27cbf 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_leftsemi.sql-plan_/join_join_to_idx_lookup_leftsemi.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_leftsemi.sql-plan_/join_join_to_idx_lookup_leftsemi.sql.plan @@ -28,6 +28,10 @@ "Key1", "Key2" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_partial_inner.sql-plan_/join_join_to_idx_lookup_partial_inner.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_partial_inner.sql-plan_/join_join_to_idx_lookup_partial_inner.sql.plan index f587e23ada..228b647872 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_partial_inner.sql-plan_/join_join_to_idx_lookup_partial_inner.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_partial_inner.sql-plan_/join_join_to_idx_lookup_partial_inner.sql.plan @@ -28,7 +28,10 @@ "Key1", "Value" ], - "type": "Scan" + "lookup_by": [ + "Key1" + ], + "type": "Lookup" } ] }, @@ -40,6 +43,9 @@ "Key", "Value" ], + "lookup_by": [ + "Key" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_partial_lefonly.sql-plan_/join_join_to_idx_lookup_partial_lefonly.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_partial_lefonly.sql-plan_/join_join_to_idx_lookup_partial_lefonly.sql.plan index ca810a2811..b3693d239a 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_partial_lefonly.sql-plan_/join_join_to_idx_lookup_partial_lefonly.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_partial_lefonly.sql-plan_/join_join_to_idx_lookup_partial_lefonly.sql.plan @@ -27,7 +27,10 @@ "columns": [ "Key1" ], - "type": "Scan" + "lookup_by": [ + "Key1" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_partial_lefsemi.sql-plan_/join_join_to_idx_lookup_partial_lefsemi.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_partial_lefsemi.sql-plan_/join_join_to_idx_lookup_partial_lefsemi.sql.plan index 16429766bc..fb567ac281 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_partial_lefsemi.sql-plan_/join_join_to_idx_lookup_partial_lefsemi.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_partial_lefsemi.sql-plan_/join_join_to_idx_lookup_partial_lefsemi.sql.plan @@ -27,7 +27,10 @@ "columns": [ "Key1" ], - "type": "Scan" + "lookup_by": [ + "Key1" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_partial_left.sql-plan_/join_join_to_idx_lookup_partial_left.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_partial_left.sql-plan_/join_join_to_idx_lookup_partial_left.sql.plan index 7f10521ce1..d06fc759eb 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_partial_left.sql-plan_/join_join_to_idx_lookup_partial_left.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_partial_left.sql-plan_/join_join_to_idx_lookup_partial_left.sql.plan @@ -28,7 +28,10 @@ "Key1", "Value" ], - "type": "Scan" + "lookup_by": [ + "Key1" + ], + "type": "Lookup" } ] }, @@ -40,6 +43,9 @@ "Key", "Value" ], + "lookup_by": [ + "Key" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_predicate_left_null.sql-plan_/join_join_to_idx_lookup_predicate_left_null.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_predicate_left_null.sql-plan_/join_join_to_idx_lookup_predicate_left_null.sql.plan index e61f3066a7..0f52621bae 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_predicate_left_null.sql-plan_/join_join_to_idx_lookup_predicate_left_null.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_predicate_left_null.sql-plan_/join_join_to_idx_lookup_predicate_left_null.sql.plan @@ -27,7 +27,10 @@ "Key1", "Value" ], - "type": "Scan" + "lookup_by": [ + "Key1" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_predicate_right.sql-plan_/join_join_to_idx_lookup_predicate_right.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_predicate_right.sql-plan_/join_join_to_idx_lookup_predicate_right.sql.plan index 8de4469d03..42e9978b4b 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_predicate_right.sql-plan_/join_join_to_idx_lookup_predicate_right.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_predicate_right.sql-plan_/join_join_to_idx_lookup_predicate_right.sql.plan @@ -30,6 +30,10 @@ "Key2", "Value" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_predicate_right_2.sql-plan_/join_join_to_idx_lookup_predicate_right_2.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_predicate_right_2.sql-plan_/join_join_to_idx_lookup_predicate_right_2.sql.plan index 28918880a4..144b7ed9d3 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_predicate_right_2.sql-plan_/join_join_to_idx_lookup_predicate_right_2.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_predicate_right_2.sql-plan_/join_join_to_idx_lookup_predicate_right_2.sql.plan @@ -29,6 +29,10 @@ "Key2", "Value" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_range_left.sql-plan_/join_join_to_idx_lookup_range_left.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_range_left.sql-plan_/join_join_to_idx_lookup_range_left.sql.plan index c101dfe9e4..5f5d16671d 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_range_left.sql-plan_/join_join_to_idx_lookup_range_left.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_range_left.sql-plan_/join_join_to_idx_lookup_range_left.sql.plan @@ -29,6 +29,10 @@ "Key2", "Value" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_right_key_range.sql-plan_/join_join_to_idx_lookup_right_key_range.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_right_key_range.sql-plan_/join_join_to_idx_lookup_right_key_range.sql.plan index 849e8d9dab..de1c9803fc 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_right_key_range.sql-plan_/join_join_to_idx_lookup_right_key_range.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_right_key_range.sql-plan_/join_join_to_idx_lookup_right_key_range.sql.plan @@ -27,6 +27,10 @@ "Key2", "Value" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_rightsemi.sql-plan_/join_join_to_idx_lookup_rightsemi.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_rightsemi.sql-plan_/join_join_to_idx_lookup_rightsemi.sql.plan index 6f6cafa10e..5432cb0470 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_rightsemi.sql-plan_/join_join_to_idx_lookup_rightsemi.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_rightsemi.sql-plan_/join_join_to_idx_lookup_rightsemi.sql.plan @@ -39,7 +39,10 @@ "Key2", "Value" ], - "type": "Scan" + "lookup_by": [ + "Key1" + ], + "type": "Lookup" }, { "columns": [ @@ -48,6 +51,10 @@ "Key2", "Value" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] @@ -78,6 +85,10 @@ "Key2", "Value" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] @@ -90,7 +101,10 @@ "Key1", "Key2" ], - "type": "Scan" + "lookup_by": [ + "Fk2" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_simple_c.sql-plan_/join_join_to_idx_lookup_simple_c.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_simple_c.sql-plan_/join_join_to_idx_lookup_simple_c.sql.plan index 7773bbb2e5..f43d16bc6a 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_simple_c.sql-plan_/join_join_to_idx_lookup_simple_c.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_to_idx_lookup_simple_c.sql-plan_/join_join_to_idx_lookup_simple_c.sql.plan @@ -30,6 +30,10 @@ "Key2", "Value" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_using_index.sql-plan_/join_join_using_index.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_using_index.sql-plan_/join_join_using_index.sql.plan index 260cd52696..291c67e6ef 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_using_index.sql-plan_/join_join_using_index.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_using_index.sql-plan_/join_join_using_index.sql.plan @@ -27,6 +27,10 @@ "Fk2", "Value" ], + "lookup_by": [ + "Key1", + "Key2" + ], "type": "Lookup" } ] @@ -39,7 +43,10 @@ "Key1", "Key2" ], - "type": "Scan" + "lookup_by": [ + "Fk2" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_with_agg.sql-plan_/join_join_with_agg.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_with_agg.sql-plan_/join_join_with_agg.sql.plan index 801dbcd678..accaa64ef0 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_with_agg.sql-plan_/join_join_with_agg.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_with_agg.sql-plan_/join_join_with_agg.sql.plan @@ -21,6 +21,9 @@ "columns": [ "Key" ], + "lookup_by": [ + "Key" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_json_insert_from_table.sql-plan_/json_insert_from_table.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_json_insert_from_table.sql-plan_/json_insert_from_table.sql.plan index c5b4ce448a..a38f5dd1ff 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_json_insert_from_table.sql-plan_/json_insert_from_table.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_json_insert_from_table.sql-plan_/json_insert_from_table.sql.plan @@ -23,6 +23,9 @@ "name": "/local/base_json_insert_from_table_sql_plan/ResultTableJD", "reads": [ { + "lookup_by": [ + "Key" + ], "type": "Lookup" } ], diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_json_insert_literal.sql-plan_/json_insert_literal.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_json_insert_literal.sql-plan_/json_insert_literal.sql.plan index d3f9021541..1324aa83b6 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_json_insert_literal.sql-plan_/json_insert_literal.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_json_insert_literal.sql-plan_/json_insert_literal.sql.plan @@ -8,6 +8,9 @@ "name": "/local/base_json_insert_literal_sql_plan/ResultLiteralJD", "reads": [ { + "lookup_by": [ + "Key" + ], "type": "Lookup" } ], diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_json_insert_params.sql-plan_/json_insert_params.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_json_insert_params.sql-plan_/json_insert_params.sql.plan index ebc1b74f8e..12d03175a1 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_json_insert_params.sql-plan_/json_insert_params.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_json_insert_params.sql-plan_/json_insert_params.sql.plan @@ -8,6 +8,9 @@ "name": "/local/base_json_insert_params_sql_plan/ResultParamsJD", "reads": [ { + "lookup_by": [ + "Key" + ], "type": "Lookup" } ], diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_write_insert.sql-plan_/write_insert.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_write_insert.sql-plan_/write_insert.sql.plan index f5024de0c2..d9b00b71fd 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_write_insert.sql-plan_/write_insert.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_write_insert.sql-plan_/write_insert.sql.plan @@ -8,6 +8,10 @@ "name": "/local/base_write_insert_sql_plan/Input", "reads": [ { + "lookup_by": [ + "key", + "subkey" + ], "type": "Lookup" } ], @@ -39,6 +43,10 @@ "type": "Scan" }, { + "lookup_by": [ + "Group", + "Name" + ], "type": "Lookup" } ], diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_write_insert_revert.sql-plan_/write_insert_revert.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_write_insert_revert.sql-plan_/write_insert_revert.sql.plan index 421bcb3001..586f7e00d2 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_write_insert_revert.sql-plan_/write_insert_revert.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_write_insert_revert.sql-plan_/write_insert_revert.sql.plan @@ -8,6 +8,10 @@ "name": "/local/base_write_insert_revert_sql_plan/Input", "reads": [ { + "lookup_by": [ + "key", + "subkey" + ], "type": "Lookup" } ], @@ -26,6 +30,10 @@ "name": "/local/base_write_insert_revert_sql_plan/Input1", "reads": [ { + "lookup_by": [ + "Group", + "Name" + ], "type": "Lookup" } ], diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_write_update_on.sql-plan_/write_update_on.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_write_update_on.sql-plan_/write_update_on.sql.plan index 5b7abb75f5..9574e68bdd 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_write_update_on.sql-plan_/write_update_on.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_write_update_on.sql-plan_/write_update_on.sql.plan @@ -12,6 +12,10 @@ "key", "subkey" ], + "lookup_by": [ + "key", + "subkey" + ], "type": "Lookup" } ], @@ -48,6 +52,10 @@ "Group", "Name" ], + "lookup_by": [ + "Group", + "Name" + ], "type": "Lookup" } ], diff --git a/ydb/tests/functional/canonical/test_sql.py b/ydb/tests/functional/canonical/test_sql.py index dcefb93fd3..cf31eed528 100644 --- a/ydb/tests/functional/canonical/test_sql.py +++ b/ydb/tests/functional/canonical/test_sql.py @@ -114,8 +114,6 @@ class BaseCanonicalTest(object): udfs_path=yatest.common.build_path("yql/udfs"), domain_name='local', use_in_memory_pdisks=True, - disable_iterator_reads=True, - disable_iterator_lookups=True, extra_feature_flags=["enable_resource_pools"] ) ) diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_1.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_1.plan index aea29c89a2..4353eb53e8 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_1.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_1.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_4", - "PlanNodeId": 33, + "Node Type": "ResultSet_2", + "PlanNodeId": 27, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 31 + "ExternalPlanNodeId": 25 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 32, + "PlanNodeId": 26, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 31, + "PlanNodeId": 25, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "TopSort-LeftJoin (MapJoin)", + "CTE Name": "precompute_1_0", + "Node Type": "TopSort-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -45,85 +46,90 @@ "Condition": "qr._equijoin_column_0 = pv.x", "Inputs": [ { - "ExternalPlanNodeId": 29 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 27 + "ExternalPlanNodeId": 23 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_1_0" } ], - "PlanNodeId": 30, + "PlanNodeId": 24, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 29, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_2_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_2_0" - } - ], - "PlanNodeId": 28 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 27, + "PlanNodeId": 23, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 26, + "PlanNodeId": 22, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 25, + "PlanNodeId": 21, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_3_0", - "Node Type": "Filter-TablePointLookup-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 19 } ], "Name": "Filter", "Predicate": "Exist(item.x)" - }, + } + ], + "PlanNodeId": 20, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } + "Columns": [ + "x" ], - "Name": "TablePointLookup", - "Path": "/Root/postgres_jointest/coalesce-and-join.test_plan/b", - "ReadColumns": [ + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ "x" ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/coalesce-and-join.test_plan/b", + "PlanNodeId": 19, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_1_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_1_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 18 + } + ], "Table": "postgres_jointest/coalesce-and-join.test_plan/b" - }, - { - "Inputs": [], - "Iterator": "precompute_3_0", - "Name": "Iterator" } - ], - "PlanNodeId": 24, - "Tables": [ - "postgres_jointest/coalesce-and-join.test_plan/b" ] } ] @@ -144,127 +150,112 @@ ] }, { - "Node Type": "Precompute_3", - "Parent Relationship": "InitPlan", - "PlanNodeId": 22, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_2_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_2_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 21 - } - ], - "Subplan Name": "CTE precompute_3_0" - }, - { - "Node Type": "Precompute_2", + "Node Type": "Precompute_1", "Parent Relationship": "InitPlan", - "PlanNodeId": 19, + "PlanNodeId": 16, "PlanNodeType": "Materialize", "Plans": [ { "Node Type": "Collect", - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Condition": "a.x = qt.x", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 1 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TablePointLookup-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.x)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } + "Columns": [ + "x" ], - "Name": "TablePointLookup", - "Path": "/Root/postgres_jointest/coalesce-and-join.test_plan/b", - "ReadColumns": [ + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ "x" ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/coalesce-and-join.test_plan/b", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/coalesce-and-join.test_plan/b" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/coalesce-and-join.test_plan/b" ] } ] @@ -280,27 +271,6 @@ ] } ], - "Subplan Name": "CTE precompute_2_0" - }, - { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], "Subplan Name": "CTE precompute_1_0" }, { @@ -389,12 +359,18 @@ "columns": [ "x" ], + "lookup_by": [ + "x" + ], "type": "Lookup" }, { "columns": [ "x" ], + "lookup_by": [ + "x" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_2.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_2.plan index 77c2ba6aff..4ba4dfdad4 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_2.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_2.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 19, + "Node Type": "ResultSet_1", + "PlanNodeId": 16, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "TopSort-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "TopSort-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -45,85 +46,90 @@ "Condition": "a.x = pv.x", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TablePointLookup-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.x)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } + "Columns": [ + "x" ], - "Name": "TablePointLookup", - "Path": "/Root/postgres_jointest/coalesce-and-join.test_plan/b", - "ReadColumns": [ + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ "x" ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/coalesce-and-join.test_plan/b", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/coalesce-and-join.test_plan/b" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/coalesce-and-join.test_plan/b" ] } ] @@ -144,27 +150,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -250,6 +235,9 @@ "columns": [ "x" ], + "lookup_by": [ + "x" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_3.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_3.plan index af67ce1c4f..21df35f344 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_3.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_3.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 19, + "Node Type": "ResultSet_1", + "PlanNodeId": 16, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "TopSort-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "TopSort-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -45,86 +46,91 @@ "Condition": "pv.x = a.x", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TableRangeScan-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.x)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/coalesce-and-join.test_plan/a", - "ReadColumns": [ + "Columns": [ "x", "y" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "x" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/coalesce-and-join.test_plan/a", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/coalesce-and-join.test_plan/a" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/coalesce-and-join.test_plan/a" ] } ] @@ -145,27 +151,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -234,7 +219,10 @@ "x", "y" ], - "type": "Scan" + "lookup_by": [ + "x" + ], + "type": "Lookup" } ] }, diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_4.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_4.plan index 2d07ec292a..2bbed1d58b 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_4.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_4.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 19, + "Node Type": "ResultSet_1", + "PlanNodeId": 16, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "TopSort-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "TopSort-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -45,85 +46,90 @@ "Condition": "yy._equijoin_column_0 = xx.pkxx", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TablePointLookup-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.pkxx)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } + "Columns": [ + "pkxx" ], - "Name": "TablePointLookup", - "Path": "/Root/postgres_jointest/coalesce-and-join.test_plan/xx", - "ReadColumns": [ + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ "pkxx" ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/coalesce-and-join.test_plan/xx", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/coalesce-and-join.test_plan/xx" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/coalesce-and-join.test_plan/xx" ] } ] @@ -144,27 +150,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -234,6 +219,9 @@ "columns": [ "pkxx" ], + "lookup_by": [ + "pkxx" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_5.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_5.plan index 698f9e3fb7..76619b2592 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_5.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_coalesce-and-join.test_/query_5.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 10 + "ExternalPlanNodeId": 8 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 10, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { @@ -45,7 +45,7 @@ "Condition": "xx.pkxx = Q._equijoin_column_0", "Inputs": [ { - "ExternalPlanNodeId": 8 + "ExternalPlanNodeId": 6 }, { "ExternalPlanNodeId": 5 @@ -54,7 +54,7 @@ "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 9, + "PlanNodeId": 7, "Plans": [ { "Node Type": "Broadcast", @@ -107,39 +107,26 @@ ] }, { - "Node Type": "Map", - "PlanNodeId": 8, - "PlanNodeType": "Connection", - "Plans": [ + "Node Type": "TableFullScan", + "Operators": [ { - "Node Type": "Stage", - "PlanNodeId": 7, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/coalesce-and-join.test_plan/xx", - "ReadColumns": [ - "pkxx" - ], - "ReadRanges": [ - "pkxx (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/coalesce-and-join.test_plan/xx" - } - ], - "PlanNodeId": 6, - "Tables": [ - "postgres_jointest/coalesce-and-join.test_plan/xx" - ] - } - ] + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/coalesce-and-join.test_plan/xx", + "ReadColumns": [ + "pkxx" + ], + "ReadRanges": [ + "pkxx (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/coalesce-and-join.test_plan/xx" } + ], + "PlanNodeId": 6, + "Tables": [ + "postgres_jointest/coalesce-and-join.test_plan/xx" ] } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join-group-by-with-null.test_/query_2.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join-group-by-with-null.test_/query_2.plan index e48a95b6fe..0bea13a30d 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join-group-by-with-null.test_/query_2.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join-group-by-with-null.test_/query_2.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 21, + "Node Type": "ResultSet_1", + "PlanNodeId": 18, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 19 + "ExternalPlanNodeId": 16 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 20, + "PlanNodeId": 17, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 19, + "PlanNodeId": 16, "PlanNodeType": "Connection", "Plans": [ { @@ -44,25 +44,26 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Name": "Aggregate", "Phase": "Final" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "KeyColumns": [ "t1.q2" ], "Node Type": "HashShuffle", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "Aggregate-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "Aggregate-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Aggregation": "{COUNT(item.t1.q1)}", @@ -79,85 +80,90 @@ "Condition": "t1.q2 = t2.q1", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TableRangeScan-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.q1)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } + "Columns": [ + "q1" ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join-group-by-with-null.test_plan/int8_tbl", - "ReadColumns": [ + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ "q1" ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join-group-by-with-null.test_plan/int8_tbl", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join-group-by-with-null.test_plan/int8_tbl" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join-group-by-with-null.test_plan/int8_tbl" ] } ] @@ -182,27 +188,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -283,7 +268,10 @@ "columns": [ "q1" ], - "type": "Scan" + "lookup_by": [ + "q1" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join-group-by-with-null.test_/query_3.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join-group-by-with-null.test_/query_3.plan index b26bfa85df..91b226a48d 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join-group-by-with-null.test_/query_3.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join-group-by-with-null.test_/query_3.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 21, + "Node Type": "ResultSet_1", + "PlanNodeId": 18, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 19 + "ExternalPlanNodeId": 16 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 20, + "PlanNodeId": 17, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 19, + "PlanNodeId": 16, "PlanNodeType": "Connection", "Plans": [ { @@ -44,25 +44,26 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Name": "Aggregate", "Phase": "Final" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "KeyColumns": [ "t1.q2" ], "Node Type": "HashShuffle", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "Aggregate-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "Aggregate-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Aggregation": "{COUNT(item.t2.q1)}", @@ -79,85 +80,90 @@ "Condition": "t1.q2 = t2.q1", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TableRangeScan-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.q1)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } + "Columns": [ + "q1" ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join-group-by-with-null.test_plan/int8_tbl", - "ReadColumns": [ + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ "q1" ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join-group-by-with-null.test_plan/int8_tbl", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join-group-by-with-null.test_plan/int8_tbl" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join-group-by-with-null.test_plan/int8_tbl" ] } ] @@ -182,27 +188,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -281,7 +266,10 @@ "columns": [ "q1" ], - "type": "Scan" + "lookup_by": [ + "q1" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_10.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_10.plan index f89d37becc..0ccf76e0a4 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_10.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_10.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 10 + "ExternalPlanNodeId": 8 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 10, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { @@ -62,7 +62,7 @@ "Condition": "a.q1 = b.unique2", "Inputs": [ { - "ExternalPlanNodeId": 8 + "ExternalPlanNodeId": 6 }, { "ExternalPlanNodeId": 5 @@ -71,7 +71,7 @@ "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 9, + "PlanNodeId": 7, "Plans": [ { "Node Type": "Broadcast", @@ -126,40 +126,27 @@ ] }, { - "Node Type": "Map", - "PlanNodeId": 8, - "PlanNodeType": "Connection", - "Plans": [ + "Node Type": "TableFullScan", + "Operators": [ { - "Node Type": "Stage", - "PlanNodeId": 7, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join0.test_plan/int8_tbl", - "ReadColumns": [ - "q1" - ], - "ReadRanges": [ - "q1 (-\u221e, +\u221e)", - "q2 (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join0.test_plan/int8_tbl" - } - ], - "PlanNodeId": 6, - "Tables": [ - "postgres_jointest/join0.test_plan/int8_tbl" - ] - } - ] + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join0.test_plan/int8_tbl", + "ReadColumns": [ + "q1" + ], + "ReadRanges": [ + "q1 (-\u221e, +\u221e)", + "q2 (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join0.test_plan/int8_tbl" } + ], + "PlanNodeId": 6, + "Tables": [ + "postgres_jointest/join0.test_plan/int8_tbl" ] } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_11.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_11.plan index 9c787afebe..f31aec6119 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_11.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_11.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 10 + "ExternalPlanNodeId": 8 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 10, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { @@ -59,7 +59,7 @@ "Condition": "a.f1 = b.unique2", "Inputs": [ { - "ExternalPlanNodeId": 8 + "ExternalPlanNodeId": 6 }, { "ExternalPlanNodeId": 5 @@ -68,7 +68,7 @@ "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 9, + "PlanNodeId": 7, "Plans": [ { "Node Type": "Broadcast", @@ -121,39 +121,26 @@ ] }, { - "Node Type": "Map", - "PlanNodeId": 8, - "PlanNodeType": "Connection", - "Plans": [ + "Node Type": "TableFullScan", + "Operators": [ { - "Node Type": "Stage", - "PlanNodeId": 7, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join0.test_plan/int4_tbl", - "ReadColumns": [ - "f1" - ], - "ReadRanges": [ - "f1 (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join0.test_plan/int4_tbl" - } - ], - "PlanNodeId": 6, - "Tables": [ - "postgres_jointest/join0.test_plan/int4_tbl" - ] - } - ] + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join0.test_plan/int4_tbl", + "ReadColumns": [ + "f1" + ], + "ReadRanges": [ + "f1 (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join0.test_plan/int4_tbl" } + ], + "PlanNodeId": 6, + "Tables": [ + "postgres_jointest/join0.test_plan/int4_tbl" ] } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_13.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_13.plan index 88da06bc41..63edcdb3fb 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_13.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_13.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 18, + "PlanNodeId": 14, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 16 + "ExternalPlanNodeId": 12 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 17, + "PlanNodeId": 13, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 16, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { @@ -57,29 +57,26 @@ "Condition": "foo1.join_key = foo3.foo2.f1", "Inputs": [ { - "ExternalPlanNodeId": 14 - }, - { - "ExternalPlanNodeId": 12 + "ExternalPlanNodeId": 10 } ], "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 15, + "PlanNodeId": 11, "Plans": [ { "Node Type": "Broadcast", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 10, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { @@ -89,7 +86,7 @@ "Condition": "foo2.f1 = ss2.unique2", "Inputs": [ { - "ExternalPlanNodeId": 8 + "ExternalPlanNodeId": 6 }, { "ExternalPlanNodeId": 5 @@ -98,9 +95,32 @@ "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 9, + "PlanNodeId": 7, "Plans": [ { + "Node Type": "TableFullScan", + "Operators": [ + { + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join0.test_plan/int4_tbl", + "ReadColumns": [ + "f1" + ], + "ReadRanges": [ + "f1 (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join0.test_plan/int4_tbl" + } + ], + "PlanNodeId": 6, + "Tables": [ + "postgres_jointest/join0.test_plan/int4_tbl" + ] + }, + { "Node Type": "Broadcast", "PlanNodeId": 5, "PlanNodeType": "Connection", @@ -149,42 +169,6 @@ ] } ] - }, - { - "Node Type": "Map", - "PlanNodeId": 8, - "PlanNodeType": "Connection", - "Plans": [ - { - "Node Type": "Stage", - "PlanNodeId": 7, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join0.test_plan/int4_tbl", - "ReadColumns": [ - "f1" - ], - "ReadRanges": [ - "f1 (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join0.test_plan/int4_tbl" - } - ], - "PlanNodeId": 6, - "Tables": [ - "postgres_jointest/join0.test_plan/int4_tbl" - ] - } - ] - } - ] } ] } @@ -193,17 +177,6 @@ ] } ] - }, - { - "Node Type": "Map", - "PlanNodeId": 14, - "PlanNodeType": "Connection", - "Plans": [ - { - "Node Type": "Stage", - "PlanNodeId": 13 - } - ] } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_14.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_14.plan index 39333ebc7b..9407af1608 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_14.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_14.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 15, + "PlanNodeId": 13, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 11 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 14, + "PlanNodeId": 12, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 13, + "PlanNodeId": 11, "PlanNodeType": "Connection", "Plans": [ { @@ -44,16 +44,13 @@ "Condition": "xx.id = yy_1.id", "Inputs": [ { - "ExternalPlanNodeId": 11 - }, - { "ExternalPlanNodeId": 9 } ], "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 12, + "PlanNodeId": 10, "Plans": [ { "Node Type": "Broadcast", @@ -161,17 +158,6 @@ ] } ] - }, - { - "Node Type": "Map", - "PlanNodeId": 11, - "PlanNodeType": "Connection", - "Plans": [ - { - "Node Type": "Stage", - "PlanNodeId": 10 - } - ] } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_15.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_15.plan index 73cb8f9b79..c468a06045 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_15.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_15.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 10 + "ExternalPlanNodeId": 8 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 10, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { @@ -44,7 +44,7 @@ "Condition": "a.f1 = b.unique2", "Inputs": [ { - "ExternalPlanNodeId": 8 + "ExternalPlanNodeId": 6 }, { "ExternalPlanNodeId": 5 @@ -53,7 +53,7 @@ "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 9, + "PlanNodeId": 7, "Plans": [ { "Node Type": "Broadcast", @@ -108,38 +108,25 @@ ] }, { - "Node Type": "Map", - "PlanNodeId": 8, - "PlanNodeType": "Connection", - "Plans": [ + "Node Type": "TablePointLookup", + "Operators": [ { - "Node Type": "Stage", - "PlanNodeId": 7, - "Plans": [ - { - "Node Type": "TablePointLookup", - "Operators": [ - { - "Inputs": [], - "Name": "TablePointLookup", - "Path": "/Root/postgres_jointest/join0.test_plan/int4_tbl", - "ReadColumns": [ - "f1" - ], - "ReadRange": [ - "f1 (0)" - ], - "Scan": "Parallel", - "Table": "postgres_jointest/join0.test_plan/int4_tbl" - } - ], - "PlanNodeId": 6, - "Tables": [ - "postgres_jointest/join0.test_plan/int4_tbl" - ] - } - ] + "Inputs": [], + "Name": "TablePointLookup", + "Path": "/Root/postgres_jointest/join0.test_plan/int4_tbl", + "ReadColumns": [ + "f1" + ], + "ReadRange": [ + "f1 (0)" + ], + "Scan": "Parallel", + "Table": "postgres_jointest/join0.test_plan/int4_tbl" } + ], + "PlanNodeId": 6, + "Tables": [ + "postgres_jointest/join0.test_plan/int4_tbl" ] } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_4.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_4.plan index a7b30808b5..51078e9033 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_4.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_4.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 10 + "ExternalPlanNodeId": 8 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 10, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { @@ -65,7 +65,7 @@ "Condition": "a.unique2 = b.tenthous", "Inputs": [ { - "ExternalPlanNodeId": 8 + "ExternalPlanNodeId": 6 }, { "ExternalPlanNodeId": 5 @@ -74,7 +74,7 @@ "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 9, + "PlanNodeId": 7, "Plans": [ { "Node Type": "Broadcast", @@ -129,40 +129,27 @@ ] }, { - "Node Type": "Map", - "PlanNodeId": 8, - "PlanNodeType": "Connection", - "Plans": [ + "Node Type": "TableRangeScan", + "Operators": [ { - "Node Type": "Stage", - "PlanNodeId": 7, - "Plans": [ - { - "Node Type": "TableRangeScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join0.test_plan/tenk1", - "ReadColumns": [ - "ten", - "unique2" - ], - "ReadRange": [ - "unique1 (42)", - "unique2 (-\u221e, +\u221e)" - ], - "Scan": "Parallel", - "Table": "postgres_jointest/join0.test_plan/tenk1" - } - ], - "PlanNodeId": 6, - "Tables": [ - "postgres_jointest/join0.test_plan/tenk1" - ] - } - ] + "Inputs": [], + "Name": "TableRangeScan", + "Path": "/Root/postgres_jointest/join0.test_plan/tenk1", + "ReadColumns": [ + "ten", + "unique2" + ], + "ReadRange": [ + "unique1 (42)", + "unique2 (-\u221e, +\u221e)" + ], + "Scan": "Parallel", + "Table": "postgres_jointest/join0.test_plan/tenk1" } + ], + "PlanNodeId": 6, + "Tables": [ + "postgres_jointest/join0.test_plan/tenk1" ] } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_6.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_6.plan index 3dd5ee6487..303dae347f 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_6.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_6.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 40, + "Node Type": "ResultSet_1", + "PlanNodeId": 31, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 38 + "ExternalPlanNodeId": 29 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 39, + "PlanNodeId": 30, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 38, + "PlanNodeId": 29, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "Limit-Filter-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "Limit-Filter-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -62,86 +63,91 @@ "Condition": "subq1.y1 = t2.unique1", "Inputs": [ { - "ExternalPlanNodeId": 36 + "InternalOperatorId": 3 }, { - "ExternalPlanNodeId": 34 + "ExternalPlanNodeId": 27 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 37, + "PlanNodeId": 28, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 36, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 35 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 34, + "PlanNodeId": 27, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 33, + "PlanNodeId": 26, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 32, + "PlanNodeId": 25, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TableRangeScan-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 23 } ], "Name": "Filter", "Predicate": "Exist(item.unique1)" - }, + } + ], + "PlanNodeId": 24, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join0.test_plan/tenk1", - "ReadColumns": [ + "Columns": [ "stringu2", "unique1" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "unique1" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join0.test_plan/tenk1", + "PlanNodeId": 23, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 22 + } + ], "Table": "postgres_jointest/join0.test_plan/tenk1" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 31, - "Tables": [ - "postgres_jointest/join0.test_plan/tenk1" ] } ] @@ -159,39 +165,18 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 29, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 28 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", - "PlanNodeId": 26, + "PlanNodeId": 20, "PlanNodeType": "Materialize", "Plans": [ { "Node Type": "Collect", - "PlanNodeId": 25, + "PlanNodeId": 19, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 24, + "PlanNodeId": 18, "PlanNodeType": "Connection", "Plans": [ { @@ -204,7 +189,7 @@ "InternalOperatorId": 1 }, { - "ExternalPlanNodeId": 19 + "ExternalPlanNodeId": 15 } ], "Name": "InnerJoin (MapJoin)" @@ -212,27 +197,27 @@ { "Inputs": [ { - "ExternalPlanNodeId": 22 + "ExternalPlanNodeId": 16 } ], "Name": "Filter", - "Predicate": "Exist(item.unique2)" + "Predicate": "Exist(item.unique2) AND item.unique2 < 42" } ], - "PlanNodeId": 23, + "PlanNodeId": 17, "Plans": [ { "Node Type": "Broadcast", - "PlanNodeId": 19, + "PlanNodeId": 15, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 18, + "PlanNodeId": 14, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 17, + "PlanNodeId": 13, "PlanNodeType": "Connection", "Plans": [ { @@ -242,29 +227,52 @@ "Condition": "i1.f1 = subq1.v1.x2", "Inputs": [ { - "ExternalPlanNodeId": 15 + "ExternalPlanNodeId": 11 }, { - "ExternalPlanNodeId": 12 + "ExternalPlanNodeId": 10 } ], "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 16, + "PlanNodeId": 12, "Plans": [ { + "Node Type": "TableFullScan", + "Operators": [ + { + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join0.test_plan/int4_tbl", + "ReadColumns": [ + "f1" + ], + "ReadRanges": [ + "f1 (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join0.test_plan/int4_tbl" + } + ], + "PlanNodeId": 11, + "Tables": [ + "postgres_jointest/join0.test_plan/int4_tbl" + ] + }, + { "Node Type": "Broadcast", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 10, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { @@ -274,7 +282,7 @@ "Condition": "v1.x1 = v2.y2", "Inputs": [ { - "ExternalPlanNodeId": 8 + "ExternalPlanNodeId": 6 }, { "ExternalPlanNodeId": 5 @@ -283,9 +291,34 @@ "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 9, + "PlanNodeId": 7, "Plans": [ { + "Node Type": "TableFullScan", + "Operators": [ + { + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join0.test_plan/ononequery1", + "ReadColumns": [ + "x1", + "x2" + ], + "ReadRanges": [ + "x1 (-\u221e, +\u221e)", + "x2 (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join0.test_plan/ononequery1" + } + ], + "PlanNodeId": 6, + "Tables": [ + "postgres_jointest/join0.test_plan/ononequery1" + ] + }, + { "Node Type": "Broadcast", "PlanNodeId": 5, "PlanNodeType": "Connection", @@ -335,44 +368,6 @@ ] } ] - }, - { - "Node Type": "Map", - "PlanNodeId": 8, - "PlanNodeType": "Connection", - "Plans": [ - { - "Node Type": "Stage", - "PlanNodeId": 7, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join0.test_plan/ononequery1", - "ReadColumns": [ - "x1", - "x2" - ], - "ReadRanges": [ - "x1 (-\u221e, +\u221e)", - "x2 (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join0.test_plan/ononequery1" - } - ], - "PlanNodeId": 6, - "Tables": [ - "postgres_jointest/join0.test_plan/ononequery1" - ] - } - ] - } - ] } ] } @@ -381,42 +376,6 @@ ] } ] - }, - { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "Node Type": "Stage", - "PlanNodeId": 14, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join0.test_plan/int4_tbl", - "ReadColumns": [ - "f1" - ], - "ReadRanges": [ - "f1 (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join0.test_plan/int4_tbl" - } - ], - "PlanNodeId": 13, - "Tables": [ - "postgres_jointest/join0.test_plan/int4_tbl" - ] - } - ] - } - ] } ] } @@ -427,52 +386,28 @@ ] }, { - "Node Type": "Map", - "PlanNodeId": 22, - "PlanNodeType": "Connection", - "Plans": [ + "Node Type": "TableFullScan", + "Operators": [ { - "Node Type": "Filter", - "Operators": [ - { - "Inputs": [ - { - "ExternalPlanNodeId": 20 - } - ], - "Name": "Filter", - "Predicate": "Exist(item.unique2) AND item.unique2 < 42" - } + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join0.test_plan/tenk1", + "ReadColumns": [ + "stringu1", + "unique2" ], - "PlanNodeId": 21, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join0.test_plan/tenk1", - "ReadColumns": [ - "stringu1", - "unique2" - ], - "ReadRanges": [ - "unique1 (-\u221e, +\u221e)", - "unique2 (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join0.test_plan/tenk1" - } - ], - "PlanNodeId": 20, - "Tables": [ - "postgres_jointest/join0.test_plan/tenk1" - ] - } - ] + "ReadRanges": [ + "unique1 (-\u221e, +\u221e)", + "unique2 (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join0.test_plan/tenk1" } + ], + "PlanNodeId": 16, + "Tables": [ + "postgres_jointest/join0.test_plan/tenk1" ] } ] @@ -559,7 +494,10 @@ "stringu2", "unique1" ], - "type": "Scan" + "lookup_by": [ + "unique1" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_9.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_9.plan index a13a0554cb..532404b202 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_9.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join0.test_/query_9.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 10 + "ExternalPlanNodeId": 8 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 10, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { @@ -60,7 +60,7 @@ "Condition": "int8_tbl.q2 = tenk1.unique2", "Inputs": [ { - "ExternalPlanNodeId": 8 + "ExternalPlanNodeId": 6 }, { "ExternalPlanNodeId": 5 @@ -69,7 +69,7 @@ "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 9, + "PlanNodeId": 7, "Plans": [ { "Node Type": "Broadcast", @@ -123,41 +123,28 @@ ] }, { - "Node Type": "Map", - "PlanNodeId": 8, - "PlanNodeType": "Connection", - "Plans": [ + "Node Type": "TableFullScan", + "Operators": [ { - "Node Type": "Stage", - "PlanNodeId": 7, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join0.test_plan/int8_tbl", - "ReadColumns": [ - "q1", - "q2" - ], - "ReadRanges": [ - "q1 (-\u221e, +\u221e)", - "q2 (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join0.test_plan/int8_tbl" - } - ], - "PlanNodeId": 6, - "Tables": [ - "postgres_jointest/join0.test_plan/int8_tbl" - ] - } - ] + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join0.test_plan/int8_tbl", + "ReadColumns": [ + "q1", + "q2" + ], + "ReadRanges": [ + "q1 (-\u221e, +\u221e)", + "q2 (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join0.test_plan/int8_tbl" } + ], + "PlanNodeId": 6, + "Tables": [ + "postgres_jointest/join0.test_plan/int8_tbl" ] } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_1.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_1.plan index 6e7ab60d2a..855d721e8e 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_1.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_1.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 13, + "Node Type": "ResultSet_1", + "PlanNodeId": 12, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,23 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 11 + "ExternalPlanNodeId": 10 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "TopSort-InnerJoin (MapJoin)-ConstantExpr-Filter-TableRangeScan-ConstantExpr", + "CTE Name": "precompute_0_0", + "Node Type": "TopSort-InnerJoin (MapJoin)-ConstantExpr-Filter", "Operators": [ { "Inputs": [ @@ -62,35 +62,55 @@ { "Inputs": [ { - "InternalOperatorId": 4 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.i)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 5 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", - "ReadColumns": [ + "Columns": [ "i", "k" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "i" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join1.test_plan/J2_TBL" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join1.test_plan/J2_TBL" ] } ], @@ -104,27 +124,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -211,7 +210,10 @@ "i", "k" ], - "type": "Scan" + "lookup_by": [ + "i" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_10.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_10.plan index 612c9f76f4..2bc7b43341 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_10.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_10.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 10 + "ExternalPlanNodeId": 8 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 10, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { @@ -45,7 +45,7 @@ "Condition": "J1_TBL.i = J2_TBL.i", "Inputs": [ { - "ExternalPlanNodeId": 8 + "ExternalPlanNodeId": 6 }, { "ExternalPlanNodeId": 5 @@ -54,7 +54,7 @@ "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 9, + "PlanNodeId": 7, "Plans": [ { "Node Type": "Broadcast", @@ -110,41 +110,28 @@ ] }, { - "Node Type": "Map", - "PlanNodeId": 8, - "PlanNodeType": "Connection", - "Plans": [ + "Node Type": "TableFullScan", + "Operators": [ { - "Node Type": "Stage", - "PlanNodeId": 7, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", - "ReadColumns": [ - "i", - "k" - ], - "ReadRanges": [ - "i (-\u221e, +\u221e)", - "k (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join1.test_plan/J2_TBL" - } - ], - "PlanNodeId": 6, - "Tables": [ - "postgres_jointest/join1.test_plan/J2_TBL" - ] - } - ] + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", + "ReadColumns": [ + "i", + "k" + ], + "ReadRanges": [ + "i (-\u221e, +\u221e)", + "k (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join1.test_plan/J2_TBL" } + ], + "PlanNodeId": 6, + "Tables": [ + "postgres_jointest/join1.test_plan/J2_TBL" ] } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_13.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_13.plan index 0afa81cab8..e62e6b979b 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_13.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_13.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 19, + "Node Type": "ResultSet_1", + "PlanNodeId": 16, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "Limit-Filter-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "Limit-Filter-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -62,86 +63,91 @@ "Condition": "J1_TBL.i = J2_TBL.i", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 3 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TableRangeScan-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.i)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", - "ReadColumns": [ + "Columns": [ "i", "k" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "i" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join1.test_plan/J2_TBL" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join1.test_plan/J2_TBL" ] } ] @@ -159,27 +165,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -270,7 +255,10 @@ "i", "k" ], - "type": "Scan" + "lookup_by": [ + "i" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_14.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_14.plan index e95666f81a..aa8c4a20c3 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_14.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_14.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 19, + "Node Type": "ResultSet_1", + "PlanNodeId": 16, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "Limit-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "Limit-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -44,86 +45,91 @@ "Condition": "J1_TBL.i = J2_TBL.i", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TableRangeScan-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.i)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", - "ReadColumns": [ + "Columns": [ "i", "k" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "i" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join1.test_plan/J2_TBL" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join1.test_plan/J2_TBL" ] } ] @@ -141,27 +147,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -253,7 +238,10 @@ "i", "k" ], - "type": "Scan" + "lookup_by": [ + "i" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_2.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_2.plan index 2b53868496..d84e3aff90 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_2.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_2.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 13, + "Node Type": "ResultSet_1", + "PlanNodeId": 12, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,23 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 11 + "ExternalPlanNodeId": 10 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "TopSort-InnerJoin (MapJoin)-ConstantExpr-Filter-TableRangeScan-ConstantExpr", + "CTE Name": "precompute_0_0", + "Node Type": "TopSort-InnerJoin (MapJoin)-ConstantExpr-Filter", "Operators": [ { "Inputs": [ @@ -62,35 +62,55 @@ { "Inputs": [ { - "InternalOperatorId": 4 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.i)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 5 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", - "ReadColumns": [ + "Columns": [ "i", "k" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "i" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join1.test_plan/J2_TBL" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join1.test_plan/J2_TBL" ] } ], @@ -106,27 +126,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -217,7 +216,10 @@ "i", "k" ], - "type": "Scan" + "lookup_by": [ + "i" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_3.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_3.plan index 2b53868496..d84e3aff90 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_3.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_3.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 13, + "Node Type": "ResultSet_1", + "PlanNodeId": 12, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,23 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 11 + "ExternalPlanNodeId": 10 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "TopSort-InnerJoin (MapJoin)-ConstantExpr-Filter-TableRangeScan-ConstantExpr", + "CTE Name": "precompute_0_0", + "Node Type": "TopSort-InnerJoin (MapJoin)-ConstantExpr-Filter", "Operators": [ { "Inputs": [ @@ -62,35 +62,55 @@ { "Inputs": [ { - "InternalOperatorId": 4 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.i)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 5 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", - "ReadColumns": [ + "Columns": [ "i", "k" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "i" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join1.test_plan/J2_TBL" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join1.test_plan/J2_TBL" ] } ], @@ -106,27 +126,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -217,7 +216,10 @@ "i", "k" ], - "type": "Scan" + "lookup_by": [ + "i" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_4.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_4.plan index a592b826b2..75535ceb02 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_4.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_4.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 10 + "ExternalPlanNodeId": 8 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 10, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { @@ -56,14 +56,14 @@ { "Inputs": [ { - "ExternalPlanNodeId": 8 + "ExternalPlanNodeId": 6 } ], "Name": "Filter", "Predicate": "Exist(item.j)" } ], - "PlanNodeId": 9, + "PlanNodeId": 7, "Plans": [ { "Node Type": "Broadcast", @@ -117,43 +117,30 @@ ] }, { - "Node Type": "Map", - "PlanNodeId": 8, - "PlanNodeType": "Connection", - "Plans": [ + "Node Type": "TableFullScan", + "Operators": [ { - "Node Type": "Stage", - "PlanNodeId": 7, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join1.test_plan/J1_TBL", - "ReadColumns": [ - "i", - "j", - "t" - ], - "ReadRanges": [ - "i (-\u221e, +\u221e)", - "j (-\u221e, +\u221e)", - "t (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join1.test_plan/J1_TBL" - } - ], - "PlanNodeId": 6, - "Tables": [ - "postgres_jointest/join1.test_plan/J1_TBL" - ] - } - ] + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join1.test_plan/J1_TBL", + "ReadColumns": [ + "i", + "j", + "t" + ], + "ReadRanges": [ + "i (-\u221e, +\u221e)", + "j (-\u221e, +\u221e)", + "t (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join1.test_plan/J1_TBL" } + ], + "PlanNodeId": 6, + "Tables": [ + "postgres_jointest/join1.test_plan/J1_TBL" ] } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_5.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_5.plan index 2b53868496..d84e3aff90 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_5.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_5.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 13, + "Node Type": "ResultSet_1", + "PlanNodeId": 12, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,23 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 11 + "ExternalPlanNodeId": 10 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "TopSort-InnerJoin (MapJoin)-ConstantExpr-Filter-TableRangeScan-ConstantExpr", + "CTE Name": "precompute_0_0", + "Node Type": "TopSort-InnerJoin (MapJoin)-ConstantExpr-Filter", "Operators": [ { "Inputs": [ @@ -62,35 +62,55 @@ { "Inputs": [ { - "InternalOperatorId": 4 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.i)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 5 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", - "ReadColumns": [ + "Columns": [ "i", "k" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "i" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join1.test_plan/J2_TBL" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join1.test_plan/J2_TBL" ] } ], @@ -106,27 +126,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -217,7 +216,10 @@ "i", "k" ], - "type": "Scan" + "lookup_by": [ + "i" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_6.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_6.plan index eb1d433fe4..69681ada03 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_6.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_6.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 10 + "ExternalPlanNodeId": 8 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 10, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { @@ -56,14 +56,14 @@ { "Inputs": [ { - "ExternalPlanNodeId": 8 + "ExternalPlanNodeId": 6 } ], "Name": "Filter", "Predicate": "Exist(item.i)" } ], - "PlanNodeId": 9, + "PlanNodeId": 7, "Plans": [ { "Node Type": "Broadcast", @@ -116,43 +116,30 @@ ] }, { - "Node Type": "Map", - "PlanNodeId": 8, - "PlanNodeType": "Connection", - "Plans": [ + "Node Type": "TableFullScan", + "Operators": [ { - "Node Type": "Stage", - "PlanNodeId": 7, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join1.test_plan/J1_TBL", - "ReadColumns": [ - "i", - "j", - "t" - ], - "ReadRanges": [ - "i (-\u221e, +\u221e)", - "j (-\u221e, +\u221e)", - "t (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join1.test_plan/J1_TBL" - } - ], - "PlanNodeId": 6, - "Tables": [ - "postgres_jointest/join1.test_plan/J1_TBL" - ] - } - ] + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join1.test_plan/J1_TBL", + "ReadColumns": [ + "i", + "j", + "t" + ], + "ReadRanges": [ + "i (-\u221e, +\u221e)", + "j (-\u221e, +\u221e)", + "t (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join1.test_plan/J1_TBL" } + ], + "PlanNodeId": 6, + "Tables": [ + "postgres_jointest/join1.test_plan/J1_TBL" ] } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_7.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_7.plan index 9859e251a0..ab2b807af7 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_7.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_7.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 19, + "Node Type": "ResultSet_1", + "PlanNodeId": 16, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "TopSort-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "TopSort-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -45,86 +46,91 @@ "Condition": "J1_TBL.i = J2_TBL.i", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TableRangeScan-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.i)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", - "ReadColumns": [ + "Columns": [ "i", "k" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "i" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join1.test_plan/J2_TBL" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join1.test_plan/J2_TBL" ] } ] @@ -148,27 +154,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -259,7 +244,10 @@ "i", "k" ], - "type": "Scan" + "lookup_by": [ + "i" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_8.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_8.plan index 9859e251a0..ab2b807af7 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_8.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_8.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 19, + "Node Type": "ResultSet_1", + "PlanNodeId": 16, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "TopSort-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "TopSort-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -45,86 +46,91 @@ "Condition": "J1_TBL.i = J2_TBL.i", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TableRangeScan-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.i)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", - "ReadColumns": [ + "Columns": [ "i", "k" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "i" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join1.test_plan/J2_TBL" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join1.test_plan/J2_TBL" ] } ] @@ -148,27 +154,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -259,7 +244,10 @@ "i", "k" ], - "type": "Scan" + "lookup_by": [ + "i" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_9.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_9.plan index 612c9f76f4..2bc7b43341 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_9.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join1.test_/query_9.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 10 + "ExternalPlanNodeId": 8 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 10, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { @@ -45,7 +45,7 @@ "Condition": "J1_TBL.i = J2_TBL.i", "Inputs": [ { - "ExternalPlanNodeId": 8 + "ExternalPlanNodeId": 6 }, { "ExternalPlanNodeId": 5 @@ -54,7 +54,7 @@ "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 9, + "PlanNodeId": 7, "Plans": [ { "Node Type": "Broadcast", @@ -110,41 +110,28 @@ ] }, { - "Node Type": "Map", - "PlanNodeId": 8, - "PlanNodeType": "Connection", - "Plans": [ + "Node Type": "TableFullScan", + "Operators": [ { - "Node Type": "Stage", - "PlanNodeId": 7, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", - "ReadColumns": [ - "i", - "k" - ], - "ReadRanges": [ - "i (-\u221e, +\u221e)", - "k (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join1.test_plan/J2_TBL" - } - ], - "PlanNodeId": 6, - "Tables": [ - "postgres_jointest/join1.test_plan/J2_TBL" - ] - } - ] + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join1.test_plan/J2_TBL", + "ReadColumns": [ + "i", + "k" + ], + "ReadRanges": [ + "i (-\u221e, +\u221e)", + "k (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join1.test_plan/J2_TBL" } + ], + "PlanNodeId": 6, + "Tables": [ + "postgres_jointest/join1.test_plan/J2_TBL" ] } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_10.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_10.plan index 1fa89569d9..dd7e6588d8 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_10.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_10.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 26, + "Node Type": "ResultSet_1", + "PlanNodeId": 23, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 24 + "ExternalPlanNodeId": 21 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 25, + "PlanNodeId": 22, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 24, + "PlanNodeId": 21, "PlanNodeType": "Connection", "Plans": [ { @@ -72,90 +72,115 @@ "Condition": "x_1.x1 = xx.x1", "Inputs": [ { - "ExternalPlanNodeId": 22 + "ExternalPlanNodeId": 19 }, { - "ExternalPlanNodeId": 14 + "ExternalPlanNodeId": 11 } ], "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 23, + "PlanNodeId": 20, "Plans": [ { "Node Type": "Map", - "PlanNodeId": 22, + "PlanNodeId": 19, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "LeftJoin (MapJoin)", + "CTE Name": "precompute_0_1", + "Node Type": "LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Condition": "x_1.x1 = y.y1", "Inputs": [ { - "ExternalPlanNodeId": 20 + "InternalOperatorId": 1 }, { - "ExternalPlanNodeId": 18 + "ExternalPlanNodeId": 17 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_1" } ], - "PlanNodeId": 21, + "PlanNodeId": 18, "Plans": [ { "Node Type": "Broadcast", - "PlanNodeId": 18, + "PlanNodeId": 17, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 17, + "PlanNodeId": 16, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 16, + "PlanNodeId": 15, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TableRangeScan-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 13 } ], "Name": "Filter", "Predicate": "Exist(item.y1)" - }, + } + ], + "PlanNodeId": 14, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join2.test_plan/y", - "ReadColumns": [ + "Columns": [ "y1", "y2" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "y1" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join2.test_plan/y", + "PlanNodeId": 13, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_1", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_1", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 12 + } + ], "Table": "postgres_jointest/join2.test_plan/y" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 15, - "Tables": [ - "postgres_jointest/join2.test_plan/y" ] } ] @@ -163,25 +188,6 @@ ] } ] - }, - { - "Node Type": "Map", - "PlanNodeId": 20, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 19 - } - ] } ] } @@ -189,20 +195,20 @@ }, { "Node Type": "Broadcast", - "PlanNodeId": 14, + "PlanNodeId": 11, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_0_1", + "CTE Name": "precompute_0_0", "Node Type": "ConstantExpr", "Operators": [ { "Inputs": [], "Name": "ToFlow", - "ToFlow": "precompute_0_1" + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 13 + "PlanNodeId": 10 } ] } @@ -218,27 +224,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 11, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 10 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0_1", "Parent Relationship": "InitPlan", "PlanNodeId": 3, @@ -370,7 +355,10 @@ "y1", "y2" ], - "type": "Scan" + "lookup_by": [ + "y1" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_11.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_11.plan index 79fc955c63..09ae150756 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_11.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_11.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 26, + "Node Type": "ResultSet_1", + "PlanNodeId": 23, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 24 + "ExternalPlanNodeId": 21 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 25, + "PlanNodeId": 22, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 24, + "PlanNodeId": 21, "PlanNodeType": "Connection", "Plans": [ { @@ -81,90 +81,115 @@ "Condition": "x_1.x1 = xx.x1", "Inputs": [ { - "ExternalPlanNodeId": 22 + "ExternalPlanNodeId": 19 }, { - "ExternalPlanNodeId": 14 + "ExternalPlanNodeId": 11 } ], "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 23, + "PlanNodeId": 20, "Plans": [ { "Node Type": "Map", - "PlanNodeId": 22, + "PlanNodeId": 19, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Condition": "x_1.x1 = y.y1", "Inputs": [ { - "ExternalPlanNodeId": 20 + "InternalOperatorId": 1 }, { - "ExternalPlanNodeId": 18 + "ExternalPlanNodeId": 17 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 21, + "PlanNodeId": 18, "Plans": [ { "Node Type": "Broadcast", - "PlanNodeId": 18, + "PlanNodeId": 17, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 17, + "PlanNodeId": 16, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 16, + "PlanNodeId": 15, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TableRangeScan-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 13 } ], "Name": "Filter", "Predicate": "Exist(item.y1)" - }, + } + ], + "PlanNodeId": 14, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join2.test_plan/y", - "ReadColumns": [ + "Columns": [ "y1", "y2" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "y1" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join2.test_plan/y", + "PlanNodeId": 13, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 12 + } + ], "Table": "postgres_jointest/join2.test_plan/y" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 15, - "Tables": [ - "postgres_jointest/join2.test_plan/y" ] } ] @@ -172,25 +197,6 @@ ] } ] - }, - { - "Node Type": "Map", - "PlanNodeId": 20, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_1", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_1" - } - ], - "PlanNodeId": 19 - } - ] } ] } @@ -198,20 +204,20 @@ }, { "Node Type": "Broadcast", - "PlanNodeId": 14, + "PlanNodeId": 11, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_0_0", + "CTE Name": "precompute_0_1", "Node Type": "ConstantExpr", "Operators": [ { "Inputs": [], "Name": "ToFlow", - "ToFlow": "precompute_0_0" + "ToFlow": "precompute_0_1" } ], - "PlanNodeId": 13 + "PlanNodeId": 10 } ] } @@ -227,27 +233,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 11, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_1", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_1", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 10 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0_1", "Parent Relationship": "InitPlan", "PlanNodeId": 3, @@ -357,7 +342,10 @@ "y1", "y2" ], - "type": "Scan" + "lookup_by": [ + "y1" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_12.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_12.plan index 1af6259f5f..a5eb014955 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_12.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_12.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 26, + "Node Type": "ResultSet_1", + "PlanNodeId": 23, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 24 + "ExternalPlanNodeId": 21 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 25, + "PlanNodeId": 22, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 24, + "PlanNodeId": 21, "PlanNodeType": "Connection", "Plans": [ { @@ -81,90 +81,115 @@ "Condition": "x_1.x1 = xx.x1", "Inputs": [ { - "ExternalPlanNodeId": 22 + "ExternalPlanNodeId": 19 }, { - "ExternalPlanNodeId": 14 + "ExternalPlanNodeId": 11 } ], "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 23, + "PlanNodeId": 20, "Plans": [ { "Node Type": "Map", - "PlanNodeId": 22, + "PlanNodeId": 19, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Condition": "x_1.x1 = y.y1", "Inputs": [ { - "ExternalPlanNodeId": 20 + "InternalOperatorId": 1 }, { - "ExternalPlanNodeId": 18 + "ExternalPlanNodeId": 17 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 21, + "PlanNodeId": 18, "Plans": [ { "Node Type": "Broadcast", - "PlanNodeId": 18, + "PlanNodeId": 17, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 17, + "PlanNodeId": 16, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 16, + "PlanNodeId": 15, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TableRangeScan-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 13 } ], "Name": "Filter", "Predicate": "Exist(item.y1)" - }, + } + ], + "PlanNodeId": 14, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join2.test_plan/y", - "ReadColumns": [ + "Columns": [ "y1", "y2" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "y1" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join2.test_plan/y", + "PlanNodeId": 13, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 12 + } + ], "Table": "postgres_jointest/join2.test_plan/y" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 15, - "Tables": [ - "postgres_jointest/join2.test_plan/y" ] } ] @@ -172,25 +197,6 @@ ] } ] - }, - { - "Node Type": "Map", - "PlanNodeId": 20, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_1", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_1" - } - ], - "PlanNodeId": 19 - } - ] } ] } @@ -198,20 +204,20 @@ }, { "Node Type": "Broadcast", - "PlanNodeId": 14, + "PlanNodeId": 11, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_0_0", + "CTE Name": "precompute_0_1", "Node Type": "ConstantExpr", "Operators": [ { "Inputs": [], "Name": "ToFlow", - "ToFlow": "precompute_0_0" + "ToFlow": "precompute_0_1" } ], - "PlanNodeId": 13 + "PlanNodeId": 10 } ] } @@ -227,27 +233,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 11, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_1", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_1", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 10 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0_1", "Parent Relationship": "InitPlan", "PlanNodeId": 3, @@ -357,7 +342,10 @@ "y1", "y2" ], - "type": "Scan" + "lookup_by": [ + "y1" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_2.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_2.plan index 2307672e56..77072a61d3 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_2.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_2.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 13, + "Node Type": "ResultSet_1", + "PlanNodeId": 12, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,23 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 11 + "ExternalPlanNodeId": 10 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "TopSort-InnerJoin (MapJoin)-ConstantExpr-Filter-TableRangeScan-ConstantExpr", + "CTE Name": "precompute_0_0", + "Node Type": "TopSort-InnerJoin (MapJoin)-ConstantExpr-Filter", "Operators": [ { "Inputs": [ @@ -62,35 +62,55 @@ { "Inputs": [ { - "InternalOperatorId": 4 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.name)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 5 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join2.test_plan/t3", - "ReadColumns": [ + "Columns": [ "n", "name" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "name" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join2.test_plan/t3", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join2.test_plan/t3" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join2.test_plan/t3" ] } ], @@ -103,27 +123,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -210,7 +209,10 @@ "n", "name" ], - "type": "Scan" + "lookup_by": [ + "name" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_3.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_3.plan index b9881162d3..9376d32f30 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_3.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_3.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 19, + "Node Type": "ResultSet_1", + "PlanNodeId": 16, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "TopSort-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "TopSort-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -45,86 +46,91 @@ "Condition": "s2.name = s3.name", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TableRangeScan-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.name)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join2.test_plan/t3", - "ReadColumns": [ + "Columns": [ "n", "name" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "name" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join2.test_plan/t3", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join2.test_plan/t3" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join2.test_plan/t3" ] } ] @@ -145,27 +151,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -252,7 +237,10 @@ "n", "name" ], - "type": "Scan" + "lookup_by": [ + "name" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_7.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_7.plan index e132301bf4..9a1500079e 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_7.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_7.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 19, + "Node Type": "ResultSet_1", + "PlanNodeId": 16, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "TopSort-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "TopSort-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -45,86 +46,91 @@ "Condition": "x.x1 = y.y1", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TableRangeScan-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.y1)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join2.test_plan/y", - "ReadColumns": [ + "Columns": [ "y1", "y2" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "y1" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join2.test_plan/y", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join2.test_plan/y" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join2.test_plan/y" ] } ] @@ -148,27 +154,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -266,7 +251,10 @@ "y1", "y2" ], - "type": "Scan" + "lookup_by": [ + "y1" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_8.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_8.plan index e607a331ce..067e7196bd 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_8.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_8.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 19, + "Node Type": "ResultSet_1", + "PlanNodeId": 16, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "TopSort-Filter-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "TopSort-Filter-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -63,86 +64,91 @@ "Condition": "x.x1 = y.y1", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 3 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TableRangeScan-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.y1)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join2.test_plan/y", - "ReadColumns": [ + "Columns": [ "y1", "y2" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "y1" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join2.test_plan/y", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join2.test_plan/y" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join2.test_plan/y" ] } ] @@ -166,27 +172,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -273,7 +258,10 @@ "y1", "y2" ], - "type": "Scan" + "lookup_by": [ + "y1" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_9.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_9.plan index 59e317075a..d968dd34b3 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_9.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join2.test_/query_9.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 26, + "Node Type": "ResultSet_1", + "PlanNodeId": 23, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 24 + "ExternalPlanNodeId": 21 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 25, + "PlanNodeId": 22, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 24, + "PlanNodeId": 21, "PlanNodeType": "Connection", "Plans": [ { @@ -72,90 +72,115 @@ "Condition": "x_1.x1 = xx.x1", "Inputs": [ { - "ExternalPlanNodeId": 22 + "ExternalPlanNodeId": 19 }, { - "ExternalPlanNodeId": 14 + "ExternalPlanNodeId": 11 } ], "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 23, + "PlanNodeId": 20, "Plans": [ { "Node Type": "Map", - "PlanNodeId": 22, + "PlanNodeId": 19, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "LeftJoin (MapJoin)", + "CTE Name": "precompute_0_1", + "Node Type": "LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Condition": "x_1.x1 = y.y1", "Inputs": [ { - "ExternalPlanNodeId": 20 + "InternalOperatorId": 1 }, { - "ExternalPlanNodeId": 18 + "ExternalPlanNodeId": 17 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_1" } ], - "PlanNodeId": 21, + "PlanNodeId": 18, "Plans": [ { "Node Type": "Broadcast", - "PlanNodeId": 18, + "PlanNodeId": 17, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 17, + "PlanNodeId": 16, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 16, + "PlanNodeId": 15, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TableRangeScan-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 13 } ], "Name": "Filter", "Predicate": "Exist(item.y1)" - }, + } + ], + "PlanNodeId": 14, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join2.test_plan/y", - "ReadColumns": [ + "Columns": [ "y1", "y2" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "y1" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join2.test_plan/y", + "PlanNodeId": 13, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_1", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_1", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 12 + } + ], "Table": "postgres_jointest/join2.test_plan/y" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 15, - "Tables": [ - "postgres_jointest/join2.test_plan/y" ] } ] @@ -163,25 +188,6 @@ ] } ] - }, - { - "Node Type": "Map", - "PlanNodeId": 20, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_1", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_1" - } - ], - "PlanNodeId": 19 - } - ] } ] } @@ -189,7 +195,7 @@ }, { "Node Type": "Broadcast", - "PlanNodeId": 14, + "PlanNodeId": 11, "PlanNodeType": "Connection", "Plans": [ { @@ -202,7 +208,7 @@ "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 13 + "PlanNodeId": 10 } ] } @@ -218,27 +224,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 11, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_1", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_1", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 10 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0_1", "Parent Relationship": "InitPlan", "PlanNodeId": 3, @@ -348,7 +333,10 @@ "y1", "y2" ], - "type": "Scan" + "lookup_by": [ + "y1" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_2.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_2.plan index 910d0fe2dd..bb7dba2401 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_2.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_2.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 19, + "Node Type": "ResultSet_1", + "PlanNodeId": 16, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "TopSort-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "TopSort-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -45,85 +46,90 @@ "Condition": "p.k = c.k", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TablePointLookup-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.k)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } + "Columns": [ + "k" ], - "Name": "TablePointLookup", - "Path": "/Root/postgres_jointest/join3.test_plan/child", - "ReadColumns": [ + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ "k" ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join3.test_plan/child", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join3.test_plan/child" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join3.test_plan/child" ] } ] @@ -144,27 +150,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -233,6 +218,9 @@ "columns": [ "k" ], + "lookup_by": [ + "k" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_3.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_3.plan index 5f4e45f765..e2feab8d92 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_3.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_3.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 10 + "ExternalPlanNodeId": 8 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 10, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { @@ -54,7 +54,7 @@ "Condition": "p.k = ss.k", "Inputs": [ { - "ExternalPlanNodeId": 8 + "ExternalPlanNodeId": 6 }, { "ExternalPlanNodeId": 5 @@ -63,7 +63,7 @@ "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 9, + "PlanNodeId": 7, "Plans": [ { "Node Type": "Broadcast", @@ -115,40 +115,27 @@ ] }, { - "Node Type": "Map", - "PlanNodeId": 8, - "PlanNodeType": "Connection", - "Plans": [ + "Node Type": "TableFullScan", + "Operators": [ { - "Node Type": "Stage", - "PlanNodeId": 7, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join3.test_plan/parent", - "ReadColumns": [ - "k", - "pd" - ], - "ReadRanges": [ - "k (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join3.test_plan/parent" - } - ], - "PlanNodeId": 6, - "Tables": [ - "postgres_jointest/join3.test_plan/parent" - ] - } - ] + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join3.test_plan/parent", + "ReadColumns": [ + "k", + "pd" + ], + "ReadRanges": [ + "k (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join3.test_plan/parent" } + ], + "PlanNodeId": 6, + "Tables": [ + "postgres_jointest/join3.test_plan/parent" ] } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_4.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_4.plan index f3468eb1d0..987d02ce0c 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_4.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_4.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_3", - "PlanNodeId": 19, + "Node Type": "ResultSet_2", + "PlanNodeId": 16, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "Limit-LeftJoin (MapJoin)", + "CTE Name": "precompute_1_0", + "Node Type": "Limit-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -44,85 +45,90 @@ "Condition": "p.k = c.k", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_1_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_1_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_1_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_2_0", - "Node Type": "Filter-TablePointLookup-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.k)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } + "Columns": [ + "k" ], - "Name": "TablePointLookup", - "Path": "/Root/postgres_jointest/join3.test_plan/child", - "ReadColumns": [ + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ "k" ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join3.test_plan/child", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_1_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_1_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join3.test_plan/child" - }, - { - "Inputs": [], - "Iterator": "precompute_2_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join3.test_plan/child" ] } ] @@ -140,27 +146,6 @@ ] }, { - "Node Type": "Precompute_2", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_1_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_1_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_2_0" - }, - { "Node Type": "Precompute_1", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -230,6 +215,9 @@ "columns": [ "k" ], + "lookup_by": [ + "k" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_5.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_5.plan index c25ebffb3e..7736170d71 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_5.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_5.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_5", - "PlanNodeId": 27, + "Node Type": "ResultSet_3", + "PlanNodeId": 23, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,23 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 25 + "ExternalPlanNodeId": 21 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 26, + "PlanNodeId": 22, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 25, + "PlanNodeId": 21, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_4_0", - "Node Type": "Limit-InnerJoin (MapJoin)-ConstantExpr-Filter-TablePointLookup-ConstantExpr", + "CTE Name": "precompute_2_0", + "Node Type": "Limit-InnerJoin (MapJoin)-ConstantExpr-Filter", "Operators": [ { "Inputs": [ @@ -56,39 +56,59 @@ { "Inputs": [], "Name": "ToFlow", - "ToFlow": "precompute_3_0" + "ToFlow": "precompute_2_0" }, { "Inputs": [ { - "InternalOperatorId": 4 + "ExternalPlanNodeId": 19 } ], "Name": "Filter", "Predicate": "Exist(item.k)" - }, + } + ], + "PlanNodeId": 20, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 5 - } + "Columns": [ + "k" ], - "Name": "TablePointLookup", - "Path": "/Root/postgres_jointest/join3.test_plan/parent", - "ReadColumns": [ + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ "k" ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join3.test_plan/parent", + "PlanNodeId": 19, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_2_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_2_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 18 + } + ], "Table": "postgres_jointest/join3.test_plan/parent" - }, - { - "Inputs": [], - "Iterator": "precompute_4_0", - "Name": "Iterator" } - ], - "PlanNodeId": 24, - "Tables": [ - "postgres_jointest/join3.test_plan/parent" ] } ] @@ -98,127 +118,112 @@ ] }, { - "Node Type": "Precompute_4", - "Parent Relationship": "InitPlan", - "PlanNodeId": 22, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_3_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_3_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 21 - } - ], - "Subplan Name": "CTE precompute_4_0" - }, - { - "Node Type": "Precompute_3", + "Node Type": "Precompute_2", "Parent Relationship": "InitPlan", - "PlanNodeId": 19, + "PlanNodeId": 16, "PlanNodeType": "Materialize", "Plans": [ { "Node Type": "Collect", - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "LeftJoin (MapJoin)", + "CTE Name": "precompute_1_0", + "Node Type": "LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Condition": "p_1.k = c.k", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 1 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_1_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_1_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_1_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_2_0", - "Node Type": "Filter-TablePointLookup-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.k)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } + "Columns": [ + "k" ], - "Name": "TablePointLookup", - "Path": "/Root/postgres_jointest/join3.test_plan/child", - "ReadColumns": [ + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ "k" ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join3.test_plan/child", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_1_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_1_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join3.test_plan/child" - }, - { - "Inputs": [], - "Iterator": "precompute_2_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join3.test_plan/child" ] } ] @@ -234,27 +239,6 @@ ] } ], - "Subplan Name": "CTE precompute_3_0" - }, - { - "Node Type": "Precompute_2", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_1_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_1_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], "Subplan Name": "CTE precompute_2_0" }, { @@ -327,6 +311,9 @@ "columns": [ "k" ], + "lookup_by": [ + "k" + ], "type": "Lookup" } ] @@ -345,6 +332,9 @@ "columns": [ "k" ], + "lookup_by": [ + "k" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_6.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_6.plan index 7ab6ea2e73..fb1718618e 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_6.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_6.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 19, + "Node Type": "ResultSet_1", + "PlanNodeId": 16, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "Limit-Filter-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "Limit-Filter-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -59,85 +60,90 @@ "Condition": "qb.a_id = qa.id", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 3 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TablePointLookup-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.id)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } + "Columns": [ + "id" ], - "Name": "TablePointLookup", - "Path": "/Root/postgres_jointest/join3.test_plan/qa", - "ReadColumns": [ + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ "id" ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join3.test_plan/qa", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join3.test_plan/qa" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join3.test_plan/qa" ] } ] @@ -155,27 +161,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -244,6 +229,9 @@ "columns": [ "id" ], + "lookup_by": [ + "id" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_7.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_7.plan index a6f522679e..cd0c5a0aba 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_7.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_7.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 19, + "Node Type": "ResultSet_1", + "PlanNodeId": 16, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "Limit-Filter-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "Limit-Filter-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -56,85 +57,90 @@ "Condition": "qb.a_id = qa.id", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 3 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TablePointLookup-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.id)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } + "Columns": [ + "id" ], - "Name": "TablePointLookup", - "Path": "/Root/postgres_jointest/join3.test_plan/qa", - "ReadColumns": [ + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ "id" ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join3.test_plan/qa", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join3.test_plan/qa" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join3.test_plan/qa" ] } ] @@ -152,27 +158,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -241,6 +226,9 @@ "columns": [ "id" ], + "lookup_by": [ + "id" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_8.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_8.plan index 53b5d0869c..026d6fca50 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_8.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join3.test_/query_8.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 11, + "PlanNodeId": 9, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 9 + "ExternalPlanNodeId": 7 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 10, + "PlanNodeId": 8, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 9, + "PlanNodeId": 7, "PlanNodeType": "Connection", "Plans": [ { @@ -45,16 +45,13 @@ "Condition": "ss1.x = ss2._equijoin_column_0", "Inputs": [ { - "ExternalPlanNodeId": 7 - }, - { "ExternalPlanNodeId": 5 } ], "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 8, + "PlanNodeId": 6, "Plans": [ { "Node Type": "Broadcast", @@ -120,17 +117,6 @@ ] } ] - }, - { - "Node Type": "Map", - "PlanNodeId": 7, - "PlanNodeType": "Connection", - "Plans": [ - { - "Node Type": "Stage", - "PlanNodeId": 6 - } - ] } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_1.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_1.plan index 0f189ca7e7..3e4296393d 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_1.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_1.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 19, + "PlanNodeId": 15, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 13 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 14, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 17, + "PlanNodeId": 13, "PlanNodeType": "Connection", "Plans": [ { @@ -53,29 +53,29 @@ "Condition": "nt3.nt2_id = ss2.nt2.id", "Inputs": [ { - "ExternalPlanNodeId": 15 + "ExternalPlanNodeId": 11 }, { - "ExternalPlanNodeId": 12 + "ExternalPlanNodeId": 10 } ], "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 16, + "PlanNodeId": 12, "Plans": [ { "Node Type": "Broadcast", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 10, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { @@ -85,7 +85,7 @@ "Condition": "nt2.nt1_id = ss1.id", "Inputs": [ { - "ExternalPlanNodeId": 8 + "ExternalPlanNodeId": 6 }, { "ExternalPlanNodeId": 5 @@ -94,9 +94,35 @@ "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 9, + "PlanNodeId": 7, "Plans": [ { + "Node Type": "TableFullScan", + "Operators": [ + { + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join4.test_plan/nt2", + "ReadColumns": [ + "b1", + "b2", + "id", + "nt1_id" + ], + "ReadRanges": [ + "id (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join4.test_plan/nt2" + } + ], + "PlanNodeId": 6, + "Tables": [ + "postgres_jointest/join4.test_plan/nt2" + ] + }, + { "Node Type": "Broadcast", "PlanNodeId": 5, "PlanNodeType": "Connection", @@ -146,45 +172,6 @@ ] } ] - }, - { - "Node Type": "Map", - "PlanNodeId": 8, - "PlanNodeType": "Connection", - "Plans": [ - { - "Node Type": "Stage", - "PlanNodeId": 7, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join4.test_plan/nt2", - "ReadColumns": [ - "b1", - "b2", - "id", - "nt1_id" - ], - "ReadRanges": [ - "id (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join4.test_plan/nt2" - } - ], - "PlanNodeId": 6, - "Tables": [ - "postgres_jointest/join4.test_plan/nt2" - ] - } - ] - } - ] } ] } @@ -195,39 +182,26 @@ ] }, { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ + "Node Type": "TablePointLookup", + "Operators": [ { - "Node Type": "Stage", - "PlanNodeId": 14, - "Plans": [ - { - "Node Type": "TablePointLookup", - "Operators": [ - { - "Inputs": [], - "Name": "TablePointLookup", - "Path": "/Root/postgres_jointest/join4.test_plan/nt3", - "ReadColumns": [ - "id", - "nt2_id" - ], - "ReadRange": [ - "id (1)" - ], - "Scan": "Parallel", - "Table": "postgres_jointest/join4.test_plan/nt3" - } - ], - "PlanNodeId": 13, - "Tables": [ - "postgres_jointest/join4.test_plan/nt3" - ] - } - ] + "Inputs": [], + "Name": "TablePointLookup", + "Path": "/Root/postgres_jointest/join4.test_plan/nt3", + "ReadColumns": [ + "id", + "nt2_id" + ], + "ReadRange": [ + "id (1)" + ], + "Scan": "Parallel", + "Table": "postgres_jointest/join4.test_plan/nt3" } + ], + "PlanNodeId": 11, + "Tables": [ + "postgres_jointest/join4.test_plan/nt3" ] } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_13.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_13.plan index 89c2ed0580..77abd52d42 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_13.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_13.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 19, + "Node Type": "ResultSet_1", + "PlanNodeId": 16, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "TopSort-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "TopSort-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -45,86 +46,91 @@ "Condition": "qrt1.a = qrt2.a", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TableRangeScan-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.a)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join4.test_plan/qrt2", - "ReadColumns": [ + "Columns": [ "a", "b" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "a" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join4.test_plan/qrt2", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join4.test_plan/qrt2" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join4.test_plan/qrt2" ] } ] @@ -146,27 +152,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -253,7 +238,10 @@ "a", "b" ], - "type": "Scan" + "lookup_by": [ + "a" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_4.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_4.plan index 88a9f431f6..c5e612c2a4 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_4.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_4.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 21, + "PlanNodeId": 17, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 19 + "ExternalPlanNodeId": 15 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 20, + "PlanNodeId": 16, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 19, + "PlanNodeId": 15, "PlanNodeType": "Connection", "Plans": [ { @@ -81,29 +81,29 @@ "Condition": "c.a = ss.a.code", "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 13 }, { - "ExternalPlanNodeId": 14 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 18, + "PlanNodeId": 14, "Plans": [ { "Node Type": "Broadcast", - "PlanNodeId": 14, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 13, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { @@ -113,7 +113,7 @@ "Condition": "a.code = b_grp.a", "Inputs": [ { - "ExternalPlanNodeId": 10 + "ExternalPlanNodeId": 8 }, { "ExternalPlanNodeId": 7 @@ -122,9 +122,32 @@ "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { + "Node Type": "TableFullScan", + "Operators": [ + { + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join4.test_plan/a", + "ReadColumns": [ + "code" + ], + "ReadRanges": [ + "code (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join4.test_plan/a" + } + ], + "PlanNodeId": 8, + "Tables": [ + "postgres_jointest/join4.test_plan/a" + ] + }, + { "Node Type": "Broadcast", "PlanNodeId": 7, "PlanNodeType": "Connection", @@ -213,42 +236,6 @@ ] } ] - }, - { - "Node Type": "Map", - "PlanNodeId": 10, - "PlanNodeType": "Connection", - "Plans": [ - { - "Node Type": "Stage", - "PlanNodeId": 9, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join4.test_plan/a", - "ReadColumns": [ - "code" - ], - "ReadRanges": [ - "code (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join4.test_plan/a" - } - ], - "PlanNodeId": 8, - "Tables": [ - "postgres_jointest/join4.test_plan/a" - ] - } - ] - } - ] } ] } @@ -259,40 +246,27 @@ ] }, { - "Node Type": "Map", - "PlanNodeId": 17, - "PlanNodeType": "Connection", - "Plans": [ + "Node Type": "TableFullScan", + "Operators": [ { - "Node Type": "Stage", - "PlanNodeId": 16, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join4.test_plan/c", - "ReadColumns": [ - "a", - "name" - ], - "ReadRanges": [ - "name (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join4.test_plan/c" - } - ], - "PlanNodeId": 15, - "Tables": [ - "postgres_jointest/join4.test_plan/c" - ] - } - ] + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join4.test_plan/c", + "ReadColumns": [ + "a", + "name" + ], + "ReadRanges": [ + "name (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join4.test_plan/c" } + ], + "PlanNodeId": 13, + "Tables": [ + "postgres_jointest/join4.test_plan/c" ] } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_5.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_5.plan index 74efc5cefb..b897c127e9 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_5.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_5.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 19, + "Node Type": "ResultSet_1", + "PlanNodeId": 16, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 17 + "ExternalPlanNodeId": 14 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 18, + "PlanNodeId": 15, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "Limit-LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "Limit-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -44,86 +45,92 @@ "Condition": "tqa.i,tqa.i,tqa.i = tqb.x,tqb.y,tqb.x", "Inputs": [ { - "ExternalPlanNodeId": 15 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 13 + "ExternalPlanNodeId": 12 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { - "Node Type": "Map", - "PlanNodeId": 15, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 14 - } - ] - }, - { "Node Type": "Broadcast", - "PlanNodeId": 13, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TablePointLookup-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.x) AND Exist(item.y)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } + "Columns": [ + "x", + "y" ], - "Name": "TablePointLookup", - "Path": "/Root/postgres_jointest/join4.test_plan/tqb", - "ReadColumns": [ + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ "x", "y" ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join4.test_plan/tqb", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join4.test_plan/tqb" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join4.test_plan/tqb" ] } ] @@ -141,27 +148,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -244,6 +230,10 @@ "x", "y" ], + "lookup_by": [ + "x", + "y" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_6.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_6.plan index 0131159e83..9b09059c16 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_6.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_6.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_4", - "PlanNodeId": 31, + "Node Type": "ResultSet_2", + "PlanNodeId": 25, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,22 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 29 + "ExternalPlanNodeId": 23 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 30, + "PlanNodeId": 24, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 29, + "PlanNodeId": 23, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "Limit-LeftJoin (MapJoin)", + "CTE Name": "precompute_1_0", + "Node Type": "Limit-LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Inputs": [ @@ -44,66 +45,90 @@ "Condition": "zt3.f3 = zt1.f1", "Inputs": [ { - "ExternalPlanNodeId": 27 + "InternalOperatorId": 2 }, { - "ExternalPlanNodeId": 25 + "ExternalPlanNodeId": 21 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_1_0" } ], - "PlanNodeId": 28, + "PlanNodeId": 22, "Plans": [ { "Node Type": "Broadcast", - "PlanNodeId": 25, + "PlanNodeId": 21, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 24, + "PlanNodeId": 20, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 23, + "PlanNodeId": 19, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_3_0", - "Node Type": "Filter-TablePointLookup-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 17 } ], "Name": "Filter", "Predicate": "Exist(item.f1)" - }, + } + ], + "PlanNodeId": 18, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } + "Columns": [ + "f1" ], - "Name": "TablePointLookup", - "Path": "/Root/postgres_jointest/join4.test_plan/zt1", - "ReadColumns": [ + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ "f1" ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join4.test_plan/zt1", + "PlanNodeId": 17, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_1_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_1_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 16 + } + ], "Table": "postgres_jointest/join4.test_plan/zt1" - }, - { - "Inputs": [], - "Iterator": "precompute_3_0", - "Name": "Iterator" } - ], - "PlanNodeId": 22, - "Tables": [ - "postgres_jointest/join4.test_plan/zt1" ] } ] @@ -111,25 +136,6 @@ ] } ] - }, - { - "Node Type": "Map", - "PlanNodeId": 27, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_2_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_2_0" - } - ], - "PlanNodeId": 26 - } - ] } ] } @@ -140,108 +146,112 @@ ] }, { - "Node Type": "Precompute_3", - "Parent Relationship": "InitPlan", - "PlanNodeId": 20, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_2_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_2_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 19 - } - ], - "Subplan Name": "CTE precompute_3_0" - }, - { - "Node Type": "Precompute_2", + "Node Type": "Precompute_1", "Parent Relationship": "InitPlan", - "PlanNodeId": 17, + "PlanNodeId": 14, "PlanNodeType": "Materialize", "Plans": [ { "Node Type": "Collect", - "PlanNodeId": 16, + "PlanNodeId": 13, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 15, + "PlanNodeId": 12, "PlanNodeType": "Connection", "Plans": [ { - "Node Type": "LeftJoin (MapJoin)", + "CTE Name": "precompute_0_0", + "Node Type": "LeftJoin (MapJoin)-ConstantExpr", "Operators": [ { "Condition": "zt2.f2 = zt3.f3", "Inputs": [ { - "ExternalPlanNodeId": 13 + "InternalOperatorId": 1 }, { - "ExternalPlanNodeId": 11 + "ExternalPlanNodeId": 10 } ], "Name": "LeftJoin (MapJoin)" + }, + { + "Inputs": [], + "Name": "ToFlow", + "ToFlow": "precompute_0_0" } ], - "PlanNodeId": 14, + "PlanNodeId": 11, "Plans": [ { "Node Type": "Broadcast", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { "Node Type": "Stage", - "PlanNodeId": 10, + "PlanNodeId": 9, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 9, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Filter-TablePointLookup-ConstantExpr", + "Node Type": "Filter", "Operators": [ { "Inputs": [ { - "InternalOperatorId": 1 + "ExternalPlanNodeId": 6 } ], "Name": "Filter", "Predicate": "Exist(item.f3)" - }, + } + ], + "PlanNodeId": 7, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 2 - } + "Columns": [ + "f3" ], - "Name": "TablePointLookup", - "Path": "/Root/postgres_jointest/join4.test_plan/zt3", - "ReadColumns": [ + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ "f3" ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join4.test_plan/zt3", + "PlanNodeId": 6, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 5 + } + ], "Table": "postgres_jointest/join4.test_plan/zt3" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 8, - "Tables": [ - "postgres_jointest/join4.test_plan/zt3" ] } ] @@ -249,25 +259,6 @@ ] } ] - }, - { - "Node Type": "Map", - "PlanNodeId": 13, - "PlanNodeType": "Connection", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "ConstantExpr", - "Operators": [ - { - "Inputs": [], - "Name": "ToFlow", - "ToFlow": "precompute_0_0" - } - ], - "PlanNodeId": 12 - } - ] } ] } @@ -276,27 +267,6 @@ ] } ], - "Subplan Name": "CTE precompute_2_0" - }, - { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 6, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 5 - } - ], "Subplan Name": "CTE precompute_1_0" }, { @@ -353,6 +323,9 @@ "columns": [ "f1" ], + "lookup_by": [ + "f1" + ], "type": "Lookup" } ] @@ -378,6 +351,9 @@ "columns": [ "f3" ], + "lookup_by": [ + "f3" + ], "type": "Lookup" } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_7.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_7.plan index 31fc2c01f0..bc8179ee8a 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_7.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_7.plan @@ -4,8 +4,8 @@ "PlanNodeType": "Query", "Plans": [ { - "Node Type": "ResultSet_2", - "PlanNodeId": 13, + "Node Type": "ResultSet_1", + "PlanNodeId": 12, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,23 +14,23 @@ { "Inputs": [ { - "ExternalPlanNodeId": 11 + "ExternalPlanNodeId": 10 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 12, + "PlanNodeId": 11, "Plans": [ { "Node Type": "UnionAll", - "PlanNodeId": 11, + "PlanNodeId": 10, "PlanNodeType": "Connection", "Plans": [ { - "CTE Name": "precompute_1_0", - "Node Type": "Limit-Filter-InnerJoin (MapJoin)-ConstantExpr-Filter-TableRangeScan-ConstantExpr", + "CTE Name": "precompute_0_0", + "Node Type": "Limit-Filter-InnerJoin (MapJoin)-ConstantExpr-Filter", "Operators": [ { "Inputs": [ @@ -79,35 +79,55 @@ { "Inputs": [ { - "InternalOperatorId": 5 + "ExternalPlanNodeId": 8 } ], "Name": "Filter", "Predicate": "Exist(item.f1)" - }, + } + ], + "PlanNodeId": 9, + "Plans": [ { - "Inputs": [ - { - "InternalOperatorId": 6 - } - ], - "Name": "TableRangeScan", - "Path": "/Root/postgres_jointest/join4.test_plan/tt6", - "ReadColumns": [ + "Columns": [ "f1", "f2" ], + "E-Cost": "No estimate", + "E-Rows": "No estimate", + "E-Size": "No estimate", + "LookupKeyColumns": [ + "f1" + ], + "Node Type": "TableLookup", + "Path": "/Root/postgres_jointest/join4.test_plan/tt6", + "PlanNodeId": 8, + "PlanNodeType": "Connection", + "Plans": [ + { + "CTE Name": "precompute_0_0", + "Node Type": "ConstantExpr-Aggregate", + "Operators": [ + { + "Inputs": [ + { + "InternalOperatorId": 1 + } + ], + "Iterator": "PartitionByKey", + "Name": "Iterator" + }, + { + "Input": "precompute_0_0", + "Inputs": [], + "Name": "PartitionByKey" + } + ], + "PlanNodeId": 7 + } + ], "Table": "postgres_jointest/join4.test_plan/tt6" - }, - { - "Inputs": [], - "Iterator": "precompute_1_0", - "Name": "Iterator" } - ], - "PlanNodeId": 10, - "Tables": [ - "postgres_jointest/join4.test_plan/tt6" ] } ] @@ -117,27 +137,6 @@ ] }, { - "Node Type": "Precompute_1", - "Parent Relationship": "InitPlan", - "PlanNodeId": 8, - "PlanNodeType": "Materialize", - "Plans": [ - { - "CTE Name": "precompute_0_0", - "Node Type": "Aggregate", - "Operators": [ - { - "Input": "precompute_0_0", - "Inputs": [], - "Name": "PartitionByKey" - } - ], - "PlanNodeId": 7 - } - ], - "Subplan Name": "CTE precompute_1_0" - }, - { "Node Type": "Precompute_0", "Parent Relationship": "InitPlan", "PlanNodeId": 5, @@ -224,7 +223,10 @@ "f1", "f2" ], - "type": "Scan" + "lookup_by": [ + "f1" + ], + "type": "Lookup" } ] } diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_8.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_8.plan index 0c6f0907f4..5d7e1a0c96 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_8.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_8.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 10 + "ExternalPlanNodeId": 8 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 10, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { @@ -45,7 +45,7 @@ "Condition": "tt1.joincol = tt2.joincol", "Inputs": [ { - "ExternalPlanNodeId": 8 + "ExternalPlanNodeId": 6 }, { "ExternalPlanNodeId": 5 @@ -54,7 +54,7 @@ "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 9, + "PlanNodeId": 7, "Plans": [ { "Node Type": "Broadcast", @@ -108,41 +108,28 @@ ] }, { - "Node Type": "Map", - "PlanNodeId": 8, - "PlanNodeType": "Connection", - "Plans": [ + "Node Type": "TableFullScan", + "Operators": [ { - "Node Type": "Stage", - "PlanNodeId": 7, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join4.test_plan/tt1", - "ReadColumns": [ - "joincol", - "tt1_id" - ], - "ReadRanges": [ - "tt1_id (-\u221e, +\u221e)", - "joincol (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join4.test_plan/tt1" - } - ], - "PlanNodeId": 6, - "Tables": [ - "postgres_jointest/join4.test_plan/tt1" - ] - } - ] + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join4.test_plan/tt1", + "ReadColumns": [ + "joincol", + "tt1_id" + ], + "ReadRanges": [ + "tt1_id (-\u221e, +\u221e)", + "joincol (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join4.test_plan/tt1" } + ], + "PlanNodeId": 6, + "Tables": [ + "postgres_jointest/join4.test_plan/tt1" ] } ] diff --git a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_9.plan b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_9.plan index f47be89616..a2051a7785 100644 --- a/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_9.plan +++ b/ydb/tests/functional/suite_tests/canondata/test_postgres.TestPGSQL.test_sql_suite_plan-jointest_join4.test_/query_9.plan @@ -5,7 +5,7 @@ "Plans": [ { "Node Type": "ResultSet", - "PlanNodeId": 12, + "PlanNodeId": 10, "PlanNodeType": "ResultSet", "Plans": [ { @@ -14,18 +14,18 @@ { "Inputs": [ { - "ExternalPlanNodeId": 10 + "ExternalPlanNodeId": 8 } ], "Limit": "1001", "Name": "Limit" } ], - "PlanNodeId": 11, + "PlanNodeId": 9, "Plans": [ { "Node Type": "Merge", - "PlanNodeId": 10, + "PlanNodeId": 8, "PlanNodeType": "Connection", "Plans": [ { @@ -45,7 +45,7 @@ "Condition": "tt2.joincol = tt1.joincol", "Inputs": [ { - "ExternalPlanNodeId": 8 + "ExternalPlanNodeId": 6 }, { "ExternalPlanNodeId": 5 @@ -54,7 +54,7 @@ "Name": "LeftJoin (MapJoin)" } ], - "PlanNodeId": 9, + "PlanNodeId": 7, "Plans": [ { "Node Type": "Broadcast", @@ -108,41 +108,28 @@ ] }, { - "Node Type": "Map", - "PlanNodeId": 8, - "PlanNodeType": "Connection", - "Plans": [ + "Node Type": "TableFullScan", + "Operators": [ { - "Node Type": "Stage", - "PlanNodeId": 7, - "Plans": [ - { - "Node Type": "TableFullScan", - "Operators": [ - { - "Inputs": [], - "Name": "TableFullScan", - "Path": "/Root/postgres_jointest/join4.test_plan/tt1", - "ReadColumns": [ - "joincol", - "tt1_id" - ], - "ReadRanges": [ - "tt1_id (-\u221e, +\u221e)", - "joincol (-\u221e, +\u221e)" - ], - "ReadRangesPointPrefixLen": "0", - "Scan": "Parallel", - "Table": "postgres_jointest/join4.test_plan/tt1" - } - ], - "PlanNodeId": 6, - "Tables": [ - "postgres_jointest/join4.test_plan/tt1" - ] - } - ] + "Inputs": [], + "Name": "TableFullScan", + "Path": "/Root/postgres_jointest/join4.test_plan/tt1", + "ReadColumns": [ + "joincol", + "tt1_id" + ], + "ReadRanges": [ + "tt1_id (-\u221e, +\u221e)", + "joincol (-\u221e, +\u221e)" + ], + "ReadRangesPointPrefixLen": "0", + "Scan": "Parallel", + "Table": "postgres_jointest/join4.test_plan/tt1" } + ], + "PlanNodeId": 6, + "Tables": [ + "postgres_jointest/join4.test_plan/tt1" ] } ] diff --git a/ydb/tests/functional/suite_tests/test_base.py b/ydb/tests/functional/suite_tests/test_base.py index 022ff0fc04..7dd88b8eed 100644 --- a/ydb/tests/functional/suite_tests/test_base.py +++ b/ydb/tests/functional/suite_tests/test_base.py @@ -276,8 +276,6 @@ class BaseSuiteRunner(object): KikimrConfigGenerator( udfs_path=yatest.common.build_path("yql/udfs"), use_in_memory_pdisks=True, - disable_iterator_reads=True, - disable_iterator_lookups=True, extra_feature_flags=["enable_resource_pools"], column_shard_config={ 'allow_nullable_columns_in_pk': True, diff --git a/ydb/tests/library/harness/kikimr_config.py b/ydb/tests/library/harness/kikimr_config.py index f53b87bdb5..2b0653795f 100644 --- a/ydb/tests/library/harness/kikimr_config.py +++ b/ydb/tests/library/harness/kikimr_config.py @@ -146,8 +146,6 @@ class KikimrConfigGenerator(object): use_legacy_pq=False, dc_mapping={}, enable_alter_database_create_hive_first=False, - disable_iterator_reads=False, - disable_iterator_lookups=False, overrided_actor_system_config=None, default_users=None, # dict[user]=password extra_feature_flags=None, # list[str] @@ -261,13 +259,6 @@ class KikimrConfigGenerator(object): self.yaml_config["local_pg_wire_config"] = {} self.yaml_config["local_pg_wire_config"]["listening_port"] = os.getenv('PGWIRE_LISTENING_PORT') - if disable_iterator_reads: - self.yaml_config["table_service_config"]["enable_kqp_scan_query_source_read"] = False - - if disable_iterator_lookups: - self.yaml_config["table_service_config"]["enable_kqp_scan_query_stream_lookup"] = False - self.yaml_config["table_service_config"]["enable_kqp_data_query_stream_lookup"] = False - self.yaml_config["feature_flags"]["enable_public_api_external_blobs"] = enable_public_api_external_blobs # for faster shutdown: there is no reason to wait while tablets are drained before whole cluster is stopping diff --git a/ydb/tests/tools/fq_runner/kikimr_runner.py b/ydb/tests/tools/fq_runner/kikimr_runner.py index c5ba66cb3c..720a237113 100644 --- a/ydb/tests/tools/fq_runner/kikimr_runner.py +++ b/ydb/tests/tools/fq_runner/kikimr_runner.py @@ -406,8 +406,6 @@ class YdbTenant(BaseTenant): KikimrConfigGenerator( domain_name='local', use_in_memory_pdisks=True, - disable_iterator_reads=True, - disable_iterator_lookups=True, port_allocator=port_allocator, dynamic_storage_pools=[ dict(name="dynamic_storage_pool:1", |