diff options
author | Svilen Mihaylov <svilen.mihaylov@mongodb.com> | 2023-02-08 17:11:54 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-02-08 23:42:45 +0000 |
commit | 7fc2af72ba09d8bfbd5efee6c2f7108acb7ad37e (patch) | |
tree | 70fe0d55bb7d5a0541ef2c435175c53935cacf91 | |
parent | f24843f504a422fb1c5dfcca796a5ad63ca4a242 (diff) | |
download | mongo-7fc2af72ba09d8bfbd5efee6c2f7108acb7ad37e.tar.gz |
SERVER-73618 [CQF] Simplify V1 and V2 explains for Root and Seek nodes
30 files changed, 342 insertions, 1487 deletions
diff --git a/src/mongo/db/exec/sbe/abt/sbe_abt_test.cpp b/src/mongo/db/exec/sbe/abt/sbe_abt_test.cpp index 9b60634b0a8..0b253533439 100644 --- a/src/mongo/db/exec/sbe/abt/sbe_abt_test.cpp +++ b/src/mongo/db/exec/sbe/abt/sbe_abt_test.cpp @@ -503,11 +503,7 @@ TEST_F(NodeSBE, Lower2) { phaseManager.optimize(root); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| RefBlock: \n" - "| Variable [pa]\n" + "Root [{pa}]\n" "MergeJoin []\n" "| | | Condition\n" "| | | rid_0 = rid_1\n" @@ -562,11 +558,7 @@ TEST_F(NodeSBE, Lower2) { // Now we should have a plan with a SortedMerge in it. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| RefBlock: \n" - "| Variable [pa]\n" + "Root [{pa}]\n" "SortedMerge []\n" "| | | collation: \n" "| | | rid_0: Ascending\n" @@ -760,11 +752,7 @@ TEST_F(NodeSBE, SpoolFibonacci) { .finish(_coscan()); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | val\n" - "| RefBlock: \n" - "| Variable [val]\n" + "Root [{val}]\n" "SpoolProducer [Lazy, id: 1, {it, val, val_prev}]\n" "| | Const [true]\n" "Union [{it, val, val_prev}]\n" diff --git a/src/mongo/db/pipeline/abt/abt_translation_test.cpp b/src/mongo/db/pipeline/abt/abt_translation_test.cpp index 5b315bcfe68..ef3fdf34cff 100644 --- a/src/mongo/db/pipeline/abt/abt_translation_test.cpp +++ b/src/mongo/db/pipeline/abt/abt_translation_test.cpp @@ -222,11 +222,7 @@ TEST_F(ServiceContextTest, CanonicalQueryTranslation) { make<ScanNode>("test", "test"), prefixId); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | test\n" - "| RefBlock: \n" - "| Variable [test]\n" + "Root [{test}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [test]\n" @@ -264,11 +260,7 @@ TEST_F(ServiceContextTest, NonDescriptiveNames) { // Observe projection names are not descriptive. They are of the form "pXXXX". ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | p4\n" - "| RefBlock: \n" - "| Variable [p4]\n" + "Root [{p4}]\n" "Evaluation [{p4}]\n" "| EvalPath []\n" "| | Const [{}]\n" @@ -279,10 +271,7 @@ TEST_F(ServiceContextTest, NonDescriptiveNames) { "| PathField [_id]\n" "| PathConstant []\n" "| Variable [p1]\n" - "GroupBy []\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [p1]\n" + "GroupBy [{p1}]\n" "| aggregations: \n" "| [p2]\n" "| FunctionCall [$sum]\n" diff --git a/src/mongo/db/query/cost_model/cost_model_test.cpp b/src/mongo/db/query/cost_model/cost_model_test.cpp index 5dba614a7eb..2c1a19cbfe4 100644 --- a/src/mongo/db/query/cost_model/cost_model_test.cpp +++ b/src/mongo/db/query/cost_model/cost_model_test.cpp @@ -73,17 +73,11 @@ TEST(CostModel, IncreaseIndexScanCost) { phaseManager.optimize(optimized); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {=Const " "[1]}]\n", optimized); @@ -110,11 +104,7 @@ TEST(CostModel, IncreaseIndexScanCost) { phaseManager.optimize(optimized); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [evalTemp_0]\n" @@ -172,11 +162,7 @@ TEST(CostModel, IncreaseJoinsCost) { ABT optimized = rootNode; phaseManager.optimize(optimized); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| RefBlock: \n" - "| Variable [pa]\n" + "Root [{pa}]\n" "MergeJoin []\n" "| | | Condition\n" "| | | rid_0 = rid_1\n" @@ -252,11 +238,7 @@ TEST(CostModel, IncreaseJoinsCost) { phaseManager.optimize(optimized); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| RefBlock: \n" - "| Variable [pa]\n" + "Root [{pa}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [evalTemp_1]\n" diff --git a/src/mongo/db/query/optimizer/explain.cpp b/src/mongo/db/query/optimizer/explain.cpp index 4e134b83104..581ad743da4 100644 --- a/src/mongo/db/query/optimizer/explain.cpp +++ b/src/mongo/db/query/optimizer/explain.cpp @@ -711,8 +711,8 @@ public: } } - static void printProjections(ExplainPrinter& printer, - const ProjectionNameOrderedSet& projections) { + template <class T> + static void printProjectionsUnordered(ExplainPrinter& printer, const T& projections) { if constexpr (version < ExplainVersion::V3) { if (!projections.empty()) { printer.separator("{"); @@ -740,25 +740,20 @@ public: } } - static void printProjections(ExplainPrinter& printer, const ProjectionNameVector& projections) { + template <class T> + static void printProjectionsOrdered(ExplainPrinter& printer, const T& projections) { ProjectionNameOrderedSet projectionSet(projections.begin(), projections.end()); - printProjections(printer, projectionSet); + printProjectionsUnordered(printer, projectionSet); } static void printProjection(ExplainPrinter& printer, const ProjectionName& projection) { - ProjectionNameOrderedSet projectionSet = {projection}; - printProjections(printer, projectionSet); + printProjectionsUnordered(printer, ProjectionNameVector{projection}); } - static void printCorrelatedProjections( - ExplainPrinter& printer, const mongo::optimizer::ProjectionNameSet& correlatedProjections) { - ProjectionNameOrderedSet ordered; - for (const ProjectionName& projName : correlatedProjections) { - ordered.insert(projName); - } - + static void printCorrelatedProjections(ExplainPrinter& printer, + const ProjectionNameSet& projections) { printer.fieldName("correlatedProjections", ExplainVersion::V3); - printProjections(printer, ordered); + printProjectionsOrdered(printer, projections); } @@ -769,7 +764,14 @@ public: const References& references, std::vector<ExplainPrinter> inResults) { ExplainPrinter printer; - printer.separator("RefBlock: ").printAppend(inResults); + if constexpr (version < ExplainVersion::V3) { + // The ref block is redundant for V1 and V2. We typically explain the references in the + // blocks ([]) of the individual elements. + } else if constexpr (version == ExplainVersion::V3) { + printer.printAppend(inResults); + } else { + MONGO_UNREACHABLE; + } return printer; } @@ -1679,12 +1681,10 @@ public: ExplainPrinter /*refsResult*/) { ExplainPrinter printer("Union"); maybePrintProps(printer, node); - if (version < ExplainVersion::V3) { + if constexpr (version < ExplainVersion::V3) { printer.separator(" ["); - printProjections(printer, node.binder().names()); + printProjectionsOrdered(printer, node.binder().names()); printer.separator("]"); - } else { - printer.separator(" []"); } nodeCEPropsPrint(printer, n, node); printer.setChildCount(childResults.size() + 1) @@ -1712,10 +1712,28 @@ public: ExplainPrinter printer("GroupBy"); maybePrintProps(printer, node); printer.separator(" ["); - if (version >= ExplainVersion::V3 || node.getType() != GroupNodeType::Complete) { + + const auto printTypeFn = [&]() { printer.fieldName("type", ExplainVersion::V3) .print(GroupNodeTypeEnum::toString[static_cast<int>(node.getType())]); + }; + bool displayGroupings = true; + if constexpr (version < ExplainVersion::V3) { + displayGroupings = false; + const auto& gbProjNames = node.getGroupByProjectionNames(); + printProjectionsUnordered(printer, gbProjNames); + if (node.getType() != GroupNodeType::Complete) { + if (!gbProjNames.empty()) { + printer.separator(", "); + } + printTypeFn(); + } + } else if constexpr (version == ExplainVersion::V3) { + printTypeFn(); + } else { + MONGO_UNREACHABLE; } + printer.separator("]"); nodeCEPropsPrint(printer, n, node); @@ -1732,7 +1750,9 @@ public: } ExplainPrinter gbPrinter; - gbPrinter.fieldName("groupings").print(refsGbResult); + if (displayGroupings) { + gbPrinter.fieldName("groupings").print(refsGbResult); + } ExplainPrinter aggPrinter; aggPrinter.fieldName("aggregations").print(aggPrinters); @@ -1753,7 +1773,14 @@ public: ExplainPrinter printer("Unwind"); maybePrintProps(printer, node); printer.separator(" ["); - printBooleanFlag(printer, "retainNonArrays", node.getRetainNonArrays(), false /*addComma*/); + + if constexpr (version < ExplainVersion::V3) { + printProjectionsUnordered( + printer, + ProjectionNameVector{node.getProjectionName(), node.getPIDProjectionName()}); + } + + printBooleanFlag(printer, "retainNonArrays", node.getRetainNonArrays(), true /*addComma*/); printer.separator("]"); nodeCEPropsPrint(printer, n, node); @@ -1815,9 +1842,9 @@ public: .separator(", ") .fieldName("id") .print(node.getSpoolId()); - if (version < ExplainVersion::V3) { + if constexpr (version < ExplainVersion::V3) { printer.separator(", "); - printProjections(printer, node.binder().names()); + printProjectionsOrdered(printer, node.binder().names()); } printer.separator("]"); @@ -1842,9 +1869,9 @@ public: .separator(", ") .fieldName("id") .print(node.getSpoolId()); - if (version < ExplainVersion::V3) { + if constexpr (version < ExplainVersion::V3) { printer.separator(", "); - printProjections(printer, node.binder().names()); + printProjectionsOrdered(printer, node.binder().names()); } printer.separator("]"); @@ -2206,7 +2233,7 @@ public: template <class P, class V, class C> static ExplainPrinter printProps(const std::string& description, const C& props) { ExplainPrinter printer; - if (version < ExplainVersion::V3) { + if constexpr (version < ExplainVersion::V3) { printer.print(description).print(":"); } @@ -2241,16 +2268,24 @@ public: ExplainPrinter refsResult) { ExplainPrinter printer("Root"); maybePrintProps(printer, node); - printer.separator(" []"); - nodeCEPropsPrint(printer, n, node); - printer.setChildCount(3); - printProjectionRequirementProperty(printer, node.getProperty(), false /*directToParent*/); - printer.fieldName("references", ExplainVersion::V3) - .print(refsResult) - .fieldName("child", ExplainVersion::V3) - .print(childResult); + if constexpr (version < ExplainVersion::V3) { + printer.separator(" ["); + printProjectionsOrdered(printer, node.getProperty().getProjections().getVector()); + printer.separator("]"); + nodeCEPropsPrint(printer, n, node); + printer.setChildCount(1, true /*noInline*/); + } else if constexpr (version == ExplainVersion::V3) { + nodeCEPropsPrint(printer, n, node); + printer.setChildCount(3); + printProjectionRequirementProperty( + printer, node.getProperty(), false /*directToParent*/); + printer.fieldName("references", ExplainVersion::V3).print(refsResult); + } else { + MONGO_UNREACHABLE; + } + printer.fieldName("child", ExplainVersion::V3).print(childResult); return printer; } diff --git a/src/mongo/db/query/optimizer/interval_simplify_test.cpp b/src/mongo/db/query/optimizer/interval_simplify_test.cpp index e50f4383c0d..92aea9eec42 100644 --- a/src/mongo/db/query/optimizer/interval_simplify_test.cpp +++ b/src/mongo/db/query/optimizer/interval_simplify_test.cpp @@ -78,34 +78,22 @@ TEST_F(IntervalIntersection, SingleFieldIntersection) { const std::string q1Text = "{a0: {$gt:14, $lt:21}}"; ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': scan_0}, coll]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "IndexScan [{'<rid>': rid_0}, scanDefName: coll, indexDefName: index1, interval: {(Const " "[14], Const [21])}]\n", optimizedQueryPlan(q1Text, testIndex)); const std::string q2Text = "{$and: [{a0: {$gt:14}}, {a0: {$lt: 21}}]}"; ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': scan_0}, coll]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "IndexScan [{'<rid>': rid_0}, scanDefName: coll, indexDefName: index1, interval: {(Const " "[14], Const [21])}]\n", optimizedQueryPlan(q2Text, testIndex)); @@ -114,21 +102,12 @@ TEST_F(IntervalIntersection, SingleFieldIntersection) { "{$or: [{$and: [{a0: {$gt:9, $lt:999}}, {a0: {$gt: 0, $lt: 12}}]}, {$and: [{a0: {$gt:40, " "$lt:997}}, {a0: {$gt:0, $lt: 44}}]}]}"; ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': scan_0}, coll]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" - "GroupBy []\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [rid_0]\n" + "GroupBy [{rid_0}]\n" "| aggregations: \n" "Union [{rid_0}]\n" "| IndexScan [{'<rid>': rid_0}, scanDefName: coll, indexDefName: index1, interval: {(Co" @@ -140,11 +119,7 @@ TEST_F(IntervalIntersection, SingleFieldIntersection) { // Contradiction: empty interval. const std::string q4Text = "{$and: [{a0: {$gt:20}}, {a0: {$lt: 20}}]}"; ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "Evaluation [{scan_0}]\n" "| Const [Nothing]\n" "LimitSkip [limit: 0, skip: 0]\n" @@ -156,17 +131,11 @@ TEST_F(IntervalIntersection, SingleFieldIntersection) { "{$or: [{$and: [{a0: {$gt:9}}, {a0: {$lt: 12}}]}, {$and: [{a0: {$gt:44}}, {a0: {$lt: " "40}}]}]}"; ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': scan_0}, coll]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "IndexScan [{'<rid>': rid_0}, scanDefName: coll, indexDefName: index1, interval: {(Const " "[9], Const [12])}]\n", optimizedQueryPlan(q5Text, testIndex)); @@ -176,11 +145,7 @@ TEST_F(IntervalIntersection, SingleFieldIntersection) { "{$or: [{$and: [{a0: {$gt:15}}, {a0: {$lt: 10}}]}, {$and: [{a0: {$gt:44}}, {a0: {$lt: " "40}}]}]}"; ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "Evaluation [{scan_0}]\n" "| Const [Nothing]\n" "LimitSkip [limit: 0, skip: 0]\n" @@ -192,11 +157,7 @@ TEST_F(IntervalIntersection, SingleFieldIntersection) { "{$or: [{$and: [{a0: {$gt:12}}, {a0: {$lt: 12}}]}, {$and: [{a0: {$gte:42}}, {a0: {$lt: " "42}}]}]}"; ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "Evaluation [{scan_0}]\n" "| Const [Nothing]\n" "LimitSkip [limit: 0, skip: 0]\n" @@ -216,11 +177,7 @@ TEST_F(IntervalIntersection, MultiFieldIntersection) { const std::string q1Text = "{$and: [{a0: {$gt: 11}}, {a0: {$lt: 14}}, {b0: {$gt: 21}}, {b0: {$lt: 12}}]}"; ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "Evaluation [{scan_0}]\n" "| Const [Nothing]\n" "LimitSkip [limit: 0, skip: 0]\n" @@ -230,11 +187,7 @@ TEST_F(IntervalIntersection, MultiFieldIntersection) { const std::string q2Text = "{$and: [{a0: {$gt: 14}}, {a0: {$lt: 11}}, {b0: {$gt: 12}}, {b0: {$lt: 21}}]}"; ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "Evaluation [{scan_0}]\n" "| Const [Nothing]\n" "LimitSkip [limit: 0, skip: 0]\n" @@ -244,11 +197,7 @@ TEST_F(IntervalIntersection, MultiFieldIntersection) { const std::string q3Text = "{$and: [{a0: {$gt: 14}}, {a0: {$lt: 11}}, {b0: {$gt: 21}}, {b0: {$lt: 12}}]}"; ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "Evaluation [{scan_0}]\n" "| Const [Nothing]\n" "LimitSkip [limit: 0, skip: 0]\n" @@ -257,11 +206,7 @@ TEST_F(IntervalIntersection, MultiFieldIntersection) { const std::string q4Text = "{$and: [{a0: 42}, {b0: {$gt: 21}}, {b0: {$lt: 12}}]}"; ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "Evaluation [{scan_0}]\n" "| Const [Nothing]\n" "LimitSkip [limit: 0, skip: 0]\n" diff --git a/src/mongo/db/query/optimizer/logical_rewriter_optimizer_test.cpp b/src/mongo/db/query/optimizer/logical_rewriter_optimizer_test.cpp index ee40c054e29..c61ffab4d4a 100644 --- a/src/mongo/db/query/optimizer/logical_rewriter_optimizer_test.cpp +++ b/src/mongo/db/query/optimizer/logical_rewriter_optimizer_test.cpp @@ -55,11 +55,7 @@ TEST(LogicalRewriter, RootNodeMerge) { std::move(limitSkipNode2)); ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " a\n" - " RefBlock: \n" - " Variable [a]\n" + "Root [{a}]\n" " LimitSkip [limit: 5, skip: 0]\n" " LimitSkip [limit: (none), skip: 10]\n" " Scan [test, {a}]\n", @@ -74,11 +70,7 @@ TEST(LogicalRewriter, RootNodeMerge) { phaseManager.optimize(rewritten); ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " a\n" - " RefBlock: \n" - " Variable [a]\n" + "Root [{a}]\n" " LimitSkip [limit: 5, skip: 10]\n" " Scan [test, {a}]\n", rewritten); @@ -244,8 +236,6 @@ TEST(LogicalRewriter, FilterProjectRewrite) { ASSERT_EXPLAIN_AUTO( "Root []\n" - " projections: \n" - " RefBlock: \n" " Filter []\n" " EvalFilter []\n" " PathIdentity []\n" @@ -257,8 +247,6 @@ TEST(LogicalRewriter, FilterProjectRewrite) { " Collation []\n" " collation: \n" " ptest: Ascending\n" - " RefBlock: \n" - " Variable [ptest]\n" " Scan [test, {ptest}]\n", rootNode); @@ -272,13 +260,9 @@ TEST(LogicalRewriter, FilterProjectRewrite) { ASSERT_EXPLAIN_AUTO( "Root []\n" - " projections: \n" - " RefBlock: \n" " Collation []\n" " collation: \n" " ptest: Ascending\n" - " RefBlock: \n" - " Variable [ptest]\n" " Filter []\n" " EvalFilter []\n" " PathIdentity []\n" @@ -326,8 +310,6 @@ TEST(LogicalRewriter, FilterProjectComplexRewrite) { ASSERT_EXPLAIN_V2_AUTO( "Root []\n" - "| | projections: \n" - "| RefBlock: \n" "Filter []\n" "| EvalFilter []\n" "| | Variable [p2]\n" @@ -347,8 +329,6 @@ TEST(LogicalRewriter, FilterProjectComplexRewrite) { "Collation []\n" "| | collation: \n" "| | ptest: Ascending\n" - "| RefBlock: \n" - "| Variable [ptest]\n" "Evaluation [{p3}]\n" "| EvalPath []\n" "| | Variable [ptest]\n" @@ -371,13 +351,9 @@ TEST(LogicalRewriter, FilterProjectComplexRewrite) { // Note: this assert depends on the order on which we consider rewrites. ASSERT_EXPLAIN_V2_AUTO( "Root []\n" - "| | projections: \n" - "| RefBlock: \n" "Collation []\n" "| | collation: \n" "| | ptest: Ascending\n" - "| RefBlock: \n" - "| Variable [ptest]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [p2]\n" @@ -439,15 +415,8 @@ TEST(LogicalRewriter, FilterProjectGroupRewrite) { phaseManager.optimize(latest); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | c\n" - "| RefBlock: \n" - "| Variable [c]\n" - "GroupBy []\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [a]\n" + "Root [{c}]\n" + "GroupBy [{a}]\n" "| aggregations: \n" "| [c]\n" "| Variable [b]\n" @@ -503,13 +472,7 @@ TEST(LogicalRewriter, FilterProjectUnwindRewrite) { phaseManager.optimize(latest); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | a\n" - "| | b\n" - "| RefBlock: \n" - "| Variable [a]\n" - "| Variable [b]\n" + "Root [{a, b}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [b]\n" @@ -518,7 +481,7 @@ TEST(LogicalRewriter, FilterProjectUnwindRewrite) { "| EvalFilter []\n" "| | Variable [a]\n" "| PathIdentity []\n" - "Unwind []\n" + "Unwind [{a, a_pid}]\n" "Evaluation [{b}]\n" "| EvalPath []\n" "| | Variable [ptest]\n" @@ -563,13 +526,7 @@ TEST(LogicalRewriter, FilterProjectExchangeRewrite) { phaseManager.optimize(latest); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | a\n" - "| | b\n" - "| RefBlock: \n" - "| Variable [a]\n" - "| Variable [b]\n" + "Root [{a, b}]\n" "Evaluation [{b}]\n" "| EvalPath []\n" "| | Variable [ptest]\n" @@ -579,8 +536,6 @@ TEST(LogicalRewriter, FilterProjectExchangeRewrite) { "| | type: HashPartitioning\n" "| | projections: \n" "| | a\n" - "| RefBlock: \n" - "| Variable [a]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [a]\n" @@ -629,19 +584,11 @@ TEST(LogicalRewriter, UnwindCollationRewrite) { phaseManager.optimize(latest); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | a\n" - "| | b\n" - "| RefBlock: \n" - "| Variable [a]\n" - "| Variable [b]\n" + "Root [{a, b}]\n" "Collation []\n" "| | collation: \n" "| | b: Ascending\n" - "| RefBlock: \n" - "| Variable [b]\n" - "Unwind []\n" + "Unwind [{a, a_pid}]\n" "Evaluation [{b}]\n" "| EvalPath []\n" "| | Variable [ptest]\n" @@ -683,11 +630,7 @@ TEST(LogicalRewriter, FilterUnionReorderSingleProjection) { ABT latest = std::move(rootNode); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pUnion\n" - "| RefBlock: \n" - "| Variable [pUnion]\n" + "Root [{pUnion}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [pUnion]\n" @@ -717,11 +660,7 @@ TEST(LogicalRewriter, FilterUnionReorderSingleProjection) { phaseManager.optimize(latest); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pUnion\n" - "| RefBlock: \n" - "| Variable [pUnion]\n" + "Root [{pUnion}]\n" "Union [{pUnion}]\n" "| Filter []\n" "| | EvalFilter []\n" @@ -799,13 +738,7 @@ TEST(LogicalRewriter, MultipleFilterUnionReorder) { ABT latest = std::move(rootNode); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pUnion1\n" - "| | pUnion2\n" - "| RefBlock: \n" - "| Variable [pUnion1]\n" - "| Variable [pUnion2]\n" + "Root [{pUnion1, pUnion2}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [pUnion2]\n" @@ -850,13 +783,7 @@ TEST(LogicalRewriter, MultipleFilterUnionReorder) { phaseManager.optimize(latest); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pUnion1\n" - "| | pUnion2\n" - "| RefBlock: \n" - "| Variable [pUnion1]\n" - "| Variable [pUnion2]\n" + "Root [{pUnion1, pUnion2}]\n" "Union [{pUnion1, pUnion2}]\n" "| Filter []\n" "| | EvalFilter []\n" @@ -937,11 +864,7 @@ TEST(LogicalRewriter, FilterUnionUnionPushdown) { ABT latest = std::move(rootNode); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | ptest\n" - "| RefBlock: \n" - "| Variable [ptest]\n" + "Root [{ptest}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [ptest]\n" @@ -959,11 +882,7 @@ TEST(LogicalRewriter, FilterUnionUnionPushdown) { phaseManager.optimize(latest); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | ptest\n" - "| RefBlock: \n" - "| Variable [ptest]\n" + "Root [{ptest}]\n" "Union [{ptest}]\n" "| Sargable [Complete]\n" "| | | | | requirementsMap: \n" @@ -1203,11 +1122,7 @@ TEST(LogicalRewriter, UnionPreservesCommonLogicalProps) { " | | type: UnknownPartitioning\n" " | logicalNodes: \n" " | logicalNodeId: 0, rule: Root\n" - " | Root []\n" - " | | | projections: \n" - " | | | a\n" - " | | RefBlock: \n" - " | | Variable [a]\n" + " | Root [{a}]\n" " | MemoLogicalDelegator [groupId: 4]\n" " physicalNodes: \n", phaseManager.getMemo()); @@ -1316,11 +1231,7 @@ TEST(LogicalRewriter, SargableCE) { " | | type: Centralized\n" " | logicalNodes: \n" " | logicalNodeId: 0, rule: Root\n" - " | Root []\n" - " | | | projections: \n" - " | | | ptest\n" - " | | RefBlock: \n" - " | | Variable [ptest]\n" + " | Root [{ptest}]\n" " | MemoLogicalDelegator [groupId: 1]\n" " physicalNodes: \n", phaseManager.getMemo()); @@ -1349,11 +1260,7 @@ TEST(LogicalRewriter, RemoveNoopFilter) { phaseManager.optimize(latest); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | ptest\n" - "| RefBlock: \n" - "| Variable [ptest]\n" + "Root [{ptest}]\n" "Scan [test, {ptest}]\n", latest); } @@ -1401,11 +1308,7 @@ TEST(LogicalRewriter, NotPushdownToplevelSuccess) { // We remove the Traverse nodes, and combine the Not ... Eq into Neq. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [scan_0]\n" @@ -1461,11 +1364,7 @@ TEST(LogicalRewriter, NotPushdownToplevelFailureMultikey) { // Because the index is multikey, we don't remove the Traverse nodes, // which prevents us from pushing down the Not. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "Filter []\n" "| UnaryOp [Not]\n" "| EvalFilter []\n" @@ -1510,11 +1409,7 @@ TEST(LogicalRewriter, NotPushdownComposeM) { // We should push the Not down as far as possible, so that some leaves become Neq. // Leaves with a Traverse in the way residualize a Not instead. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [scan_0]\n" @@ -1593,11 +1488,7 @@ TEST(LogicalRewriter, NotPushdownUnderLambdaSuccess) { // All the Traverses should be eliminated, and the Not ... Eq combined as Neq. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [scan_0]\n" @@ -1674,11 +1565,7 @@ TEST(LogicalRewriter, NotPushdownUnderLambdaKeepOuterTraverse) { // The inner Traverses should be eliminated, and the Not ... Eq combined as Neq. // We have to keep the outer traverse since 'a' is multikey. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [scan_0]\n" @@ -1742,11 +1629,7 @@ TEST(LogicalRewriter, NotPushdownUnderLambdaFailsWithFreeVar) { // The Not should be gone: combined into Neq. // But the Lambda [x] should still be there, because 'x' is still used. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [scan_0]\n" @@ -1807,11 +1690,7 @@ TEST(LogicalRewriter, RemoveTraverseSplitComposeM) { // We should end up with a Sargable node and no residual Filter. ASSERT_EXPLAIN_V2_AUTO( // NOLINT (test auto-update) - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "Sargable [Complete]\n" "| | | | requirementsMap: \n" "| | | | refProjection: scan_0, path: 'PathGet [a] PathGet [b] PathIdentity [" @@ -1884,11 +1763,7 @@ TEST(LogicalRewriter, TraverseComposeMTraverse) { // of doubly-nested arrays. // (We may also get a perfOnly Sargable node; that's not the point of this test.) ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [scan_0]\n" + "Root [{scan_0}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [scan_0]\n" @@ -1966,11 +1841,7 @@ TEST(LogicalRewriter, RelaxComposeM) { phaseManager.optimize(optimized); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [root]\n" @@ -2189,11 +2060,7 @@ TEST(LogicalRewriter, EmptyArrayIndexBounds) { phaseManager.optimize(rootNode); ASSERT_EXPLAIN_V2_AUTO( // NOLINT (test auto-update) - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [root]\n" diff --git a/src/mongo/db/query/optimizer/optimizer_test.cpp b/src/mongo/db/query/optimizer/optimizer_test.cpp index e5c27f26d55..2b2deaca2ce 100644 --- a/src/mongo/db/query/optimizer/optimizer_test.cpp +++ b/src/mongo/db/query/optimizer/optimizer_test.cpp @@ -278,13 +278,7 @@ TEST(Optimizer, Basic) { std::move(evalNode)); ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " P1\n" - " ptest\n" - " RefBlock: \n" - " Variable [P1]\n" - " Variable [ptest]\n" + "Root [{P1, ptest}]\n" " Evaluation [{P1}]\n" " EvalPath []\n" " PathConstant []\n" @@ -302,13 +296,7 @@ TEST(Optimizer, Basic) { ABT clonedNode = rootNode; ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " P1\n" - " ptest\n" - " RefBlock: \n" - " Variable [P1]\n" - " Variable [ptest]\n" + "Root [{P1, ptest}]\n" " Evaluation [{P1}]\n" " EvalPath []\n" " PathConstant []\n" @@ -356,22 +344,8 @@ TEST(Optimizer, GroupBy) { std::move(groupByNode)); ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " p1\n" - " p2\n" - " a1\n" - " a2\n" - " RefBlock: \n" - " Variable [a1]\n" - " Variable [a2]\n" - " Variable [p1]\n" - " Variable [p2]\n" - " GroupBy []\n" - " groupings: \n" - " RefBlock: \n" - " Variable [p1]\n" - " Variable [p2]\n" + "Root [{a1, a2, p1, p2}]\n" + " GroupBy [{p1, p2}]\n" " aggregations: \n" " [a1]\n" " Const [10]\n" @@ -424,13 +398,7 @@ TEST(Optimizer, Union) { } ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " ptest\n" - " B\n" - " RefBlock: \n" - " Variable [B]\n" - " Variable [ptest]\n" + "Root [{B, ptest}]\n" " Union [{B, ptest}]\n" " Evaluation [{B}]\n" " Const [3]\n" @@ -487,16 +455,8 @@ TEST(Optimizer, Unwind) { } ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " p1\n" - " p2\n" - " p2pid\n" - " RefBlock: \n" - " Variable [p1]\n" - " Variable [p2]\n" - " Variable [p2pid]\n" - " Unwind [retainNonArrays]\n" + "Root [{p1, p2, p2pid}]\n" + " Unwind [{p2, p2pid}, retainNonArrays]\n" " Evaluation [{p2}]\n" " EvalPath []\n" " PathConstant []\n" @@ -530,9 +490,6 @@ TEST(Optimizer, Collation) { " collation: \n" " a: Ascending\n" " b: Clustered\n" - " RefBlock: \n" - " Variable [a]\n" - " Variable [b]\n" " Evaluation [{b}]\n" " EvalPath []\n" " PathConstant []\n" @@ -587,8 +544,6 @@ TEST(Optimizer, Distribution) { " type: HashPartitioning\n" " projections: \n" " b\n" - " RefBlock: \n" - " Variable [b]\n" " Evaluation [{b}]\n" " EvalPath []\n" " PathConstant []\n" @@ -801,11 +756,7 @@ TEST(Optimizer, ExplainRIDUnion) { std::move(unionNode)); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "RIDUnion [root]\n" "| Scan [c1, {root}]\n" "Filter []\n" diff --git a/src/mongo/db/query/optimizer/physical_rewriter_optimizer_test.cpp b/src/mongo/db/query/optimizer/physical_rewriter_optimizer_test.cpp index 4cb7b093b30..2ae1dbe73c3 100644 --- a/src/mongo/db/query/optimizer/physical_rewriter_optimizer_test.cpp +++ b/src/mongo/db/query/optimizer/physical_rewriter_optimizer_test.cpp @@ -84,11 +84,7 @@ TEST(PhysRewriter, PhysicalRewriterBasic) { ASSERT_EQ(5, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | p2\n" - "| RefBlock: \n" - "| Variable [p2]\n" + "Root [{p2}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [p2]\n" @@ -127,11 +123,7 @@ TEST(PhysRewriter, PhysicalRewriterBasic) { "| type: Centralized\n" "| indexingRequirement: \n" "| Complete, dedupRID\n" - "Root []\n" - "| | projections: \n" - "| | p2\n" - "| RefBlock: \n" - "| Variable [p2]\n" + "Root [{p2}]\n" "Properties [cost: 0.438321, localCost: 0.00983406, adjustedCE: 10]\n" "| | Logical:\n" "| | cardinalityEstimate: \n" @@ -275,11 +267,7 @@ TEST(PhysRewriter, GroupBy) { ASSERT_EQ(7, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | c\n" - "| RefBlock: \n" - "| Variable [c]\n" + "Root [{c}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [a]\n" @@ -288,10 +276,7 @@ TEST(PhysRewriter, GroupBy) { "| EvalFilter []\n" "| | Variable [c]\n" "| PathIdentity []\n" - "GroupBy []\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [a]\n" + "GroupBy [{a}]\n" "| aggregations: \n" "| [c]\n" "| Variable [b]\n" @@ -351,14 +336,8 @@ TEST(PhysRewriter, GroupBy1) { // Projection "pb1" is unused and we do not generate an aggregation expression for it. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pb\n" - "| RefBlock: \n" - "| Variable [pb]\n" + "Root [{pb}]\n" "GroupBy []\n" - "| | groupings: \n" - "| | RefBlock: \n" "| aggregations: \n" "| [pb]\n" "| Variable [pa]\n" @@ -409,13 +388,7 @@ TEST(PhysRewriter, Unwind) { ASSERT_EQ(7, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | a\n" - "| | b\n" - "| RefBlock: \n" - "| Variable [a]\n" - "| Variable [b]\n" + "Root [{a, b}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [b]\n" @@ -424,7 +397,7 @@ TEST(PhysRewriter, Unwind) { "| EvalFilter []\n" "| | Variable [a]\n" "| PathIdentity []\n" - "Unwind []\n" + "Unwind [{a, a_pid}]\n" "Evaluation [{b}]\n" "| EvalPath []\n" "| | Variable [ptest]\n" @@ -477,11 +450,7 @@ TEST(PhysRewriter, DuplicateFilter) { // Only one copy of the filter. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [evalTemp_2]\n" @@ -534,16 +503,10 @@ TEST(PhysRewriter, FilterCollation) { // Limit-skip is attached to the collation node by virtue of physical props. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pb\n" - "| RefBlock: \n" - "| Variable [pb]\n" + "Root [{pb}]\n" "Collation []\n" "| | collation: \n" "| | pb: Ascending\n" - "| RefBlock: \n" - "| Variable [pb]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [evalTemp_1]\n" @@ -585,16 +548,10 @@ TEST(PhysRewriter, EvalCollation) { ASSERT_EQ(4, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| RefBlock: \n" - "| Variable [pa]\n" + "Root [{pa}]\n" "Collation []\n" "| | collation: \n" "| | pa: Ascending\n" - "| RefBlock: \n" - "| Variable [pa]\n" "PhysicalScan [{'a': pa}, c1]\n", optimized); } @@ -638,16 +595,10 @@ TEST(PhysRewriter, FilterEvalCollation) { ASSERT_EQ(4, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Collation []\n" "| | collation: \n" "| | pa: Ascending\n" - "| RefBlock: \n" - "| Variable [pa]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [pa]\n" @@ -692,18 +643,13 @@ TEST(PhysRewriter, FilterIndexing) { phaseManager.optimize(optimized); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "RIDIntersect [root]\n" "| Scan [c1, {root}]\n" "Sargable [Index]\n" "| | | requirementsMap: \n" "| | | refProjection: root, path: 'PathGet [a] PathTraverse [1] PathIdentity " - "[]" - "', intervals: {{{=Const [1]}}}\n" + "[]', intervals: {{{=Const [1]}}}\n" "| | candidateIndexes: \n" "| | candidateId: 1, index1, {}, {SimpleEquality}, {{{=Const [1]}}}\n" "Scan [c1, {root}]\n", @@ -728,20 +674,13 @@ TEST(PhysRewriter, FilterIndexing) { // Test sargable filter is satisfied with an index scan. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {=Const " - "[1" - "]}]\n", + "[1]}]\n", optimized); } @@ -762,11 +701,7 @@ TEST(PhysRewriter, FilterIndexing) { // Test we can optimize sargable filter nodes even without an index. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [evalTemp_0]\n" @@ -822,11 +757,7 @@ TEST(PhysRewriter, FilterIndexing1) { ASSERT_EQ(7, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | p1\n" - "| RefBlock: \n" - "| Variable [p1]\n" + "Root [{p1}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [p1]\n" @@ -888,17 +819,11 @@ TEST(PhysRewriter, FilterIndexing2) { ASSERT_EQ(4, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {=Const [1" "]}]\n", optimized); @@ -960,17 +885,11 @@ TEST(PhysRewriter, FilterIndexing2NonSarg) { // Demonstrate non-sargable evaluation and filter are moved under the NLJ+seek, ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [pb]\n" @@ -1070,11 +989,7 @@ TEST(PhysRewriter, FilterIndexing3) { // We dont need a Seek if we dont have multi-key paths. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| RefBlock: \n" - "| Variable [pa]\n" + "Root [{pa}]\n" "IndexScan [{'<indexKey> 0': pa}, scanDefName: c1, indexDefName: index1, interval: {[Const " "[1 | minKey], Const [1 | maxKey]]}]\n", optimized); @@ -1122,17 +1037,11 @@ TEST(PhysRewriter, FilterIndexing3MultiKey) { // We need a Seek to obtain value for "a". ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| RefBlock: \n" - "| Variable [pa]\n" + "Root [{pa}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'a': pa}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "Unique []\n" "| projections: \n" "| rid_0\n" @@ -1225,11 +1134,7 @@ TEST(PhysRewriter, FilterIndexing4) { } ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| RefBlock: \n" - "| Variable [pa]\n" + "Root [{pa}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [evalTemp_14]\n" @@ -1308,18 +1213,10 @@ TEST(PhysRewriter, FilterIndexing5) { // We can cover both fields with the index, and need separate sort on "b". ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| | pb\n" - "| RefBlock: \n" - "| Variable [pa]\n" - "| Variable [pb]\n" + "Root [{pa, pb}]\n" "Collation []\n" "| | collation: \n" "| | pb: Ascending\n" - "| RefBlock: \n" - "| Variable [pb]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [pb]\n" @@ -1391,15 +1288,9 @@ TEST(PhysRewriter, FilterIndexing6) { // We can cover both fields with the index, and do not need a separate sort on "b". ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| | pb\n" - "| RefBlock: \n" - "| Variable [pa]\n" - "| Variable [pb]\n" - "IndexScan [{'<indexKey> 0': pa, '<indexKey> 1': pb}, scanDefName: c1, indexDefName: inde" - "x1, interval: {(Const [0 | 0], Const [0 | maxKey]]}]\n", + "Root [{pa, pb}]\n" + "IndexScan [{'<indexKey> 0': pa, '<indexKey> 1': pb}, scanDefName: c1, indexDefName: " + "index1, interval: {(Const [0 | 0], Const [0 | maxKey]]}]\n", optimized); } @@ -1545,21 +1436,12 @@ TEST(PhysRewriter, FilterIndexingVariable) { // (max(param_0, param_1), Const [maxKey]] U [param_0 > param_1 ? MaxKey : param_1, max(param_0, // param_1)] ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" - "GroupBy []\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [rid_0]\n" + "GroupBy [{rid_0}]\n" "| aggregations: \n" "Union [{rid_0}]\n" "| IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {[If [" @@ -1623,11 +1505,7 @@ TEST(PhysRewriter, FilterIndexingMaxKey) { // Observe redundant predicate a <= MaxKey is removed. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [evalTemp_3]\n" @@ -1692,17 +1570,11 @@ TEST(PhysRewriter, FilterIndexingRIN) { // Demonstrate RIN plan which consists of three equality prefixes. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "NestedLoopJoin [joinType: Inner, {evalTemp_57, evalTemp_58}]\n" "| | Const [true]\n" "| NestedLoopJoin [joinType: Inner, {evalTemp_57, evalTemp_58, evalTemp_59, " @@ -1791,21 +1663,11 @@ TEST(PhysRewriter, FilterIndexingRIN1) { // Observe how the index scan for the first equality prefix (on "a") is reversed while the // second one (on "a") is not. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| | pa\n" - "| | pb\n" - "| RefBlock: \n" - "| Variable [pa]\n" - "| Variable [pb]\n" - "| Variable [root]\n" + "Root [{pa, pb, root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "NestedLoopJoin [joinType: Inner, {pa}]\n" "| | Const [true]\n" "| IndexScan [{'<indexKey> 1': pb, '<rid>': rid_0}, scanDefName: c1, indexDefName: " @@ -1872,25 +1734,12 @@ TEST(PhysRewriter, FilterIndexingRIN2) { ASSERT_BETWEEN(5, 10, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| | pa\n" - "| | pb\n" - "| RefBlock: \n" - "| Variable [pa]\n" - "| Variable [pb]\n" - "| Variable [root]\n" + "Root [{pa, pb, root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" - "GroupBy []\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [rid_0]\n" + "GroupBy [{rid_0}]\n" "| aggregations: \n" "| [pa]\n" "| FunctionCall [$first]\n" @@ -1901,10 +1750,7 @@ TEST(PhysRewriter, FilterIndexingRIN2) { "Union [{disjunction_0, disjunction_1, rid_0}]\n" "| NestedLoopJoin [joinType: Inner, {disjunction_0}]\n" "| | | Const [true]\n" - "| | GroupBy []\n" - "| | | | groupings: \n" - "| | | | RefBlock: \n" - "| | | | Variable [rid_0]\n" + "| | GroupBy [{rid_0}]\n" "| | | aggregations: \n" "| | | [disjunction_1]\n" "| | | FunctionCall [$first]\n" @@ -1930,10 +1776,7 @@ TEST(PhysRewriter, FilterIndexingRIN2) { "interval: {[Const [3 | minKey], Const [4 | maxKey]]}]\n" "NestedLoopJoin [joinType: Inner, {disjunction_0}]\n" "| | Const [true]\n" - "| GroupBy []\n" - "| | | groupings: \n" - "| | | RefBlock: \n" - "| | | Variable [rid_0]\n" + "| GroupBy [{rid_0}]\n" "| | aggregations: \n" "| | [disjunction_1]\n" "| | FunctionCall [$first]\n" @@ -1997,11 +1840,7 @@ TEST(PhysRewriter, SargableProjectionRenames) { // Demonstrate we can combine the field access to "a" into a single entry and provide two output // projections. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Evaluation [{pa1}]\n" "| Variable [pa]\n" "Sargable [Complete]\n" @@ -2049,11 +1888,7 @@ TEST(PhysRewriter, SargableAcquireProjection) { // Demonstrate that we combine the field access for the filter and eval nodes. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Sargable [Complete]\n" "| | | | requirementsMap: \n" "| | | | refProjection: root, path: 'PathGet [a] PathIdentity []', boundProje" @@ -2113,11 +1948,7 @@ TEST(PhysRewriter, FilterReorder) { // Observe filters are ordered from most selective (lowest sel) to least selective (highest // sel). ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [evalTemp_14]\n" @@ -2197,17 +2028,11 @@ TEST(PhysRewriter, CoveredScan) { // Since we do not optimize with fast null handling, we need to split the predicate between the // index scan and fetch in order to handle null. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| RefBlock: \n" - "| Variable [pa]\n" + "Root [{pa}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'a': pa}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {<Const [1" "]}]\n", optimized); @@ -2255,14 +2080,9 @@ TEST(PhysRewriter, EvalIndexing) { // Should not need a collation node. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| RefBlock: \n" - "| Variable [pa]\n" + "Root [{pa}]\n" "IndexScan [{'<indexKey> 0': pa}, scanDefName: c1, indexDefName: index1, interval: " - "{>Cons" - "t [1]}]\n", + "{>Const [1]}]\n", optimized); } @@ -2287,19 +2107,12 @@ TEST(PhysRewriter, EvalIndexing) { // Index does not have the right collation and now we need a collation node. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| RefBlock: \n" - "| Variable [pa]\n" + "Root [{pa}]\n" "Collation []\n" "| | collation: \n" "| | pa: Ascending\n" - "| RefBlock: \n" - "| Variable [pa]\n" "IndexScan [{'<indexKey> 0': pa}, scanDefName: c1, indexDefName: index1, interval: " - "{>Cons" - "t [1]}]\n", + "{>Const [1]}]\n", optimized); } } @@ -2344,19 +2157,13 @@ TEST(PhysRewriter, EvalIndexing1) { ASSERT_EQ(8, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" - "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {=Const [1" - "]}]\n", + "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {=Const " + "[1]}]\n", optimized); } @@ -2410,11 +2217,7 @@ TEST(PhysRewriter, EvalIndexing2) { // Verify collation is subsumed into the index scan. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa2\n" - "| RefBlock: \n" - "| Variable [pa2]\n" + "Root [{pa2}]\n" "Evaluation [{pa3}]\n" "| Variable [pa1]\n" "Evaluation [{pa2}]\n" @@ -2499,34 +2302,22 @@ TEST(PhysRewriter, MultiKeyIndex) { // CollationNode. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Collation []\n" "| | collation: \n" "| | pa: Ascending\n" "| | pb: Ascending\n" - "| RefBlock: \n" - "| Variable [pa]\n" - "| Variable [pb]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "Filter []\n" "| EvalFilter []\n" "| | FunctionCall [getArraySize]\n" "| | Variable [sides_0]\n" "| PathCompare [Eq]\n" "| Const [2]\n" - "GroupBy []\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [rid_0]\n" + "GroupBy [{rid_0}]\n" "| aggregations: \n" "| [pa]\n" "| FunctionCall [$max]\n" @@ -2567,17 +2358,11 @@ TEST(PhysRewriter, MultiKeyIndex) { // Index2 will be used in reverse direction. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "HashJoin [joinType: Inner]\n" "| | Condition\n" "| | rid_0 = rid_2\n" @@ -2998,21 +2783,12 @@ TEST(PhysRewriter, CompoundIndex5) { // and [=1, =3]. // TODO: SERVER-70298: we should be seeing merge joins instead of union+groupby. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" - "GroupBy []\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [rid_0]\n" + "GroupBy [{rid_0}]\n" "| aggregations: \n" "Union [{rid_0}]\n" "| | | IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval" @@ -3154,19 +2930,13 @@ TEST(PhysRewriter, IndexBoundsIntersect1) { // Demonstrate we can intersect the intervals since we have non-multikey paths, and the // collation requirement is satisfied via the index scan. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" - "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {(Const [7" - "0], Const [90])}]\n", + "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {(Const " + "[70], Const [90])}]\n", optimized); } @@ -3218,22 +2988,16 @@ TEST(PhysRewriter, IndexBoundsIntersect2) { // Demonstrate we can intersect the bounds here because composition does not contain // traverse. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "Unique []\n" "| projections: \n" "| rid_0\n" - "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {(Const [7" - "0], Const [90])}]\n", + "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {(Const " + "[70], Const [90])}]\n", optimized); } @@ -3290,11 +3054,7 @@ TEST(PhysRewriter, IndexBoundsIntersect3) { // We do not intersect the bounds, because the outer composition is over the different fields. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [root]\n" @@ -3382,11 +3142,7 @@ TEST(PhysRewriter, IndexResidualReq) { "| type: Centralized\n" "| indexingRequirement: \n" "| Complete, dedupRID\n" - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| RefBlock: \n" - "| Variable [pa]\n" + "Root [{pa}]\n" "Properties [cost: 0.176361, localCost: 0.176361, adjustedCE: 330]\n" "| | Logical:\n" "| | cardinalityEstimate: \n" @@ -3490,17 +3246,11 @@ TEST(PhysRewriter, IndexResidualReq1) { // Prefer index1 over index2 and index3 in order to cover all fields. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {[Const [0" " | 0 | 0 | minKey], Const [0 | 0 | 0 | maxKey]]}]\n", optimized); @@ -3552,17 +3302,11 @@ TEST(PhysRewriter, IndexResidualReq2) { // We can cover "b" with the index and filter before we Seek. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "Unique []\n" "| projections: \n" "| rid_0\n" @@ -3614,11 +3358,7 @@ TEST(PhysRewriter, ElemMatchIndex) { ASSERT_EQ(6, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| Filter []\n" @@ -3627,8 +3367,6 @@ TEST(PhysRewriter, ElemMatchIndex) { "| | PathArr []\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root, 'a': evalTemp_4}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "Unique []\n" "| projections: \n" "| rid_0\n" @@ -3689,11 +3427,7 @@ TEST(PhysRewriter, ElemMatchIndex1) { // Demonstrate we can cover both the filter and the extracted elemMatch predicate with the // index. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| Filter []\n" @@ -3702,8 +3436,6 @@ TEST(PhysRewriter, ElemMatchIndex1) { "| | PathArr []\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root, 'a': evalTemp_17}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "Unique []\n" "| projections: \n" "| rid_0\n" @@ -3754,11 +3486,7 @@ TEST(PhysRewriter, ElemMatchIndexNoArrays) { // If we do not have arrays (index is not multikey) we simplify to unsatisfiable query. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Evaluation [{root}]\n" "| Const [Nothing]\n" "LimitSkip [limit: 0, skip: 0]\n" @@ -3826,11 +3554,7 @@ TEST(PhysRewriter, ObjectElemMatchResidual) { // So the 'ComposeA PathArr PathObj' is redundant and we could remove it. ASSERT_EXPLAIN_V2Compact_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [root]\n" @@ -3849,8 +3573,6 @@ TEST(PhysRewriter, ObjectElemMatchResidual) { "| | PathArr []\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root, 'a': evalTemp_3}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "Unique []\n" "| projections: \n" "| rid_0\n" @@ -3914,11 +3636,7 @@ TEST(PhysRewriter, ObjectElemMatchBounds) { // We should pick the index, and generate bounds for the 'b' predicate. ASSERT_EXPLAIN_V2Compact_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [root]\n" @@ -3937,10 +3655,8 @@ TEST(PhysRewriter, ObjectElemMatchBounds) { "| | PathArr []\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root, 'a': evalTemp_2}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" - "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {=Const [4" - "]}]\n", + "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {=Const " + "[4]}]\n", optimized); } @@ -3992,11 +3708,7 @@ TEST(PhysRewriter, NestedElemMatch) { // PathArr bounds, but that only tells us which documents have arrays-of-arrays; then we can run // a residual predicate to check that the inner array contains '2'. ASSERT_EXPLAIN_V2Compact_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [root]\n" @@ -4011,16 +3723,11 @@ TEST(PhysRewriter, NestedElemMatch) { "| | PathArr []\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root, 'a': evalTemp_2}, coll1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "Filter []\n" "| EvalFilter []\n" "| | FunctionCall [getArraySize] Variable [sides_0]\n" "| PathCompare [Eq] Const [2]\n" - "GroupBy []\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [rid_0]\n" + "GroupBy [{rid_0}]\n" "| aggregations: \n" "| [sides_0]\n" "| FunctionCall [$addToSet] Variable [sideId_0]\n" @@ -4079,17 +3786,11 @@ TEST(PhysRewriter, PathObj) { // We should get index bounds for the PathObj. ASSERT_EXPLAIN_V2Compact_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "Unique []\n" "| projections: \n" "| rid_0\n" @@ -4155,11 +3856,7 @@ TEST(PhysRewriter, ArrayConstantIndex) { // original filter. We have index bound with the array itself unioned with bound using the first // array element. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [root]\n" @@ -4174,12 +3871,7 @@ TEST(PhysRewriter, ArrayConstantIndex) { "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" - "GroupBy []\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [rid_0]\n" + "GroupBy [{rid_0}]\n" "| aggregations: \n" "Union [{rid_0}]\n" "| IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {=Cons" @@ -4240,11 +3932,7 @@ TEST(PhysRewriter, ArrayConstantNoIndex) { // Without an index, we retain the original array bounds predicate, and do not duplicate the // predicates in the sargable node (they are perf only) ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [root]\n" @@ -4298,15 +3986,10 @@ TEST(PhysRewriter, ParallelScan) { ASSERT_EQ(4, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Exchange []\n" "| | distribution: \n" "| | type: Centralized\n" - "| RefBlock: \n" "Filter []\n" "| EvalFilter []\n" "| | Variable [evalTemp_0]\n" @@ -4360,19 +4043,11 @@ TEST(PhysRewriter, HashPartitioning) { ASSERT_BETWEEN(5, 10, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pc\n" - "| RefBlock: \n" - "| Variable [pc]\n" + "Root [{pc}]\n" "Exchange []\n" "| | distribution: \n" "| | type: Centralized\n" - "| RefBlock: \n" - "GroupBy []\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [pa]\n" + "GroupBy [{pa}]\n" "| aggregations: \n" "| [pc]\n" "| Variable [pb]\n" @@ -4446,19 +4121,11 @@ TEST(PhysRewriter, IndexPartitioning0) { ASSERT_BETWEEN(60, 100, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pc\n" - "| RefBlock: \n" - "| Variable [pc]\n" + "Root [{pc}]\n" "Exchange []\n" "| | distribution: \n" "| | type: Centralized\n" - "| RefBlock: \n" - "GroupBy []\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [pa]\n" + "GroupBy [{pa}]\n" "| aggregations: \n" "| [pc]\n" "| Variable [pb]\n" @@ -4467,8 +4134,6 @@ TEST(PhysRewriter, IndexPartitioning0) { "| | type: HashPartitioning\n" "| | projections: \n" "| | pa\n" - "| RefBlock: \n" - "| Variable [pa]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| Filter []\n" @@ -4478,12 +4143,9 @@ TEST(PhysRewriter, IndexPartitioning0) { "| | Const [1]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'b': pb}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "Exchange []\n" "| | distribution: \n" "| | type: RoundRobin\n" - "| RefBlock: \n" "IndexScan [{'<indexKey> 0': pa, '<rid>': rid_0}, scanDefName: c1, indexDefName: index1, " "interval: {>Const [0]}]\n", optimized); @@ -4627,21 +4289,11 @@ TEST(PhysRewriter, LocalGlobalAgg) { ASSERT_BETWEEN(15, 25, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| | pc\n" - "| RefBlock: \n" - "| Variable [pa]\n" - "| Variable [pc]\n" + "Root [{pa, pc}]\n" "Exchange []\n" "| | distribution: \n" "| | type: Centralized\n" - "| RefBlock: \n" - "GroupBy [Global]\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [pa]\n" + "GroupBy [{pa}, Global]\n" "| aggregations: \n" "| [pc]\n" "| FunctionCall [$sum]\n" @@ -4651,12 +4303,7 @@ TEST(PhysRewriter, LocalGlobalAgg) { "| | type: HashPartitioning\n" "| | projections: \n" "| | pa\n" - "| RefBlock: \n" - "| Variable [pa]\n" - "GroupBy [Local]\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [pa]\n" + "GroupBy [{pa}, Local]\n" "| aggregations: \n" "| [preagg_0]\n" "| FunctionCall [$sum]\n" @@ -4701,14 +4348,8 @@ TEST(PhysRewriter, LocalGlobalAgg1) { ASSERT_BETWEEN(5, 15, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pc\n" - "| RefBlock: \n" - "| Variable [pc]\n" + "Root [{pc}]\n" "GroupBy [Global]\n" - "| | groupings: \n" - "| | RefBlock: \n" "| aggregations: \n" "| [pc]\n" "| FunctionCall [$sum]\n" @@ -4716,10 +4357,7 @@ TEST(PhysRewriter, LocalGlobalAgg1) { "Exchange []\n" "| | distribution: \n" "| | type: Centralized\n" - "| RefBlock: \n" "GroupBy [Local]\n" - "| | groupings: \n" - "| | RefBlock: \n" "| aggregations: \n" "| [preagg_0]\n" "| FunctionCall [$sum]\n" @@ -4770,11 +4408,7 @@ TEST(PhysRewriter, LocalLimitSkip) { "| Physical:\n" "| distribution: \n" "| type: Centralized\n" - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Properties [cost: 0.00929774, localCost: 0.00252777, adjustedCE: 30]\n" "| | Logical:\n" "| | cardinalityEstimate: \n" @@ -4823,7 +4457,6 @@ TEST(PhysRewriter, LocalLimitSkip) { "Exchange []\n" "| | distribution: \n" "| | type: Centralized\n" - "| RefBlock: \n" "Properties [cost: 0.00376897, localCost: 0.00376897, adjustedCE: 30]\n" "| | Logical:\n" "| | cardinalityEstimate: \n" @@ -4898,11 +4531,7 @@ TEST(PhysRewriter, CollationLimit) { "| Physical:\n" "| distribution: \n" "| type: Centralized\n" - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Properties [cost: 4.75042, localCost: 4.32193, adjustedCE: 20]\n" "| | Logical:\n" "| | cardinalityEstimate: \n" @@ -4934,8 +4563,6 @@ TEST(PhysRewriter, CollationLimit) { "Collation []\n" "| | collation: \n" "| | pa: Ascending\n" - "| RefBlock: \n" - "| Variable [pa]\n" "Properties [cost: 0.428487, localCost: 0.428487, adjustedCE: 1000]\n" "| | Logical:\n" "| | cardinalityEstimate: \n" @@ -5023,11 +4650,7 @@ TEST(PhysRewriter, PartialIndex1) { // Partial schema requirement is not on an index field. We get a seek on this field. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| Filter []\n" @@ -5038,8 +4661,6 @@ TEST(PhysRewriter, PartialIndex1) { "| | Const [2]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root, 'b': evalTemp_4}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {=Const [3" "]}]\n", optimized); @@ -5094,19 +4715,13 @@ TEST(PhysRewriter, PartialIndex2) { // Partial schema requirement on an index field. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" - "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {=Const [3" - "]}]\n", + "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {=Const " + "[3]}]\n", optimized); } @@ -5166,11 +4781,7 @@ TEST(PhysRewriter, PartialIndexReject) { // Incompatible partial filter. Use scan. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [evalTemp_3]\n" @@ -5218,13 +4829,7 @@ TEST(PhysRewriter, RequireRID) { // Make sure the Scan node returns rid, and the Root node refers to it. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | rid_0\n" - "| | root\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" - "| Variable [root]\n" + "Root [{rid_0, root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [evalTemp_0]\n" @@ -5260,13 +4865,7 @@ TEST(PhysRewriter, RequireRID1) { ASSERT_EQ(3, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | rid_0\n" - "| | scan_0\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" - "| Variable [scan_0]\n" + "Root [{rid_0, scan_0}]\n" "Filter []\n" "| Const [true]\n" "PhysicalScan [{'<rid>': rid_0, '<root>': scan_0}, c1]\n", @@ -5319,11 +4918,7 @@ TEST(PhysRewriter, UnionRewrite) { ASSERT_EQ(4, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pUnion1\n" - "| RefBlock: \n" - "| Variable [pUnion1]\n" + "Root [{pUnion1}]\n" "Union [{pUnion1}]\n" "| PhysicalScan [{'a': pUnion1}, test2]\n" "PhysicalScan [{'a': pUnion1}, test1]\n", @@ -5380,13 +4975,7 @@ TEST(PhysRewriter, JoinRewrite) { ASSERT_EQ(4, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | p11\n" - "| | p21\n" - "| RefBlock: \n" - "| Variable [p11]\n" - "| Variable [p21]\n" + "Root [{p11, p21}]\n" "NestedLoopJoin [joinType: Inner, ]\n" "| | BinaryOp [Eq]\n" "| | | Variable [p22]\n" @@ -5452,13 +5041,7 @@ TEST(PhysRewriter, JoinRewrite1) { // Demonstrate index nested loop join and variable interval intersection. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | p1\n" - "| | p2\n" - "| RefBlock: \n" - "| Variable [p1]\n" - "| Variable [p2]\n" + "Root [{p1, p2}]\n" "NestedLoopJoin [joinType: Inner, {p1, p2}]\n" "| | Const [true]\n" "| IndexScan [{}, scanDefName: test2, indexDefName: index1, interval: {>If [] BinaryOp " @@ -5496,11 +5079,7 @@ TEST(PhysRewriter, RootInterval) { ASSERT_EQ(2, phaseManager.getMemo().getStats()._physPlanExplorationCount); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [root]\n" @@ -5541,11 +5120,7 @@ TEST(PhysRewriter, ResidualFilterPathIsBalanced) { // because it can't be satisfied with an index. The path under the resulting FilterNode should // be balanced. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [evalTemp_0]\n" @@ -5612,11 +5187,7 @@ TEST(PhysRewriter, DisjunctiveEqsConsolidatedIntoEqMember) { // be combined into one EqMember path that accounts for all original separate Eq and EqMember // paths, as well as one Gt path and one Lt path. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [evalTemp_0]\n" @@ -5662,11 +5233,7 @@ TEST(PhysRewriter, KeepBoundsForNothingCheck) { // sbe::nothing will not pass the (Minkey, Maxkey) check. Check that we don't get rid of it. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [evalTemp_0]\n" @@ -5716,26 +5283,19 @@ TEST(PhysRewriter, EqMemberSargable) { phaseManager.optimize(optimized); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Sargable [Complete]\n" "| | | | requirementsMap: \n" "| | | | refProjection: root, path: 'PathGet [a] PathIdentity []', " - "intervals:" - " {{{=Const [1]}} U {{=Const [2]}} U {{=Const [3]}}}\n" + "intervals: {{{=Const [1]}} U {{=Const [2]}} U {{=Const [3]}}}\n" "| | | candidateIndexes: \n" "| | | candidateId: 1, index1, {}, {Compound}, {{{=Const [1]}} U {{=Const " - "[2]}}" - " U {{=Const [3]}}}\n" + "[2]}} U {{=Const [3]}}}\n" "| | scanParams: \n" "| | {'a': evalTemp_0}\n" "| | residualReqs: \n" "| | refProjection: evalTemp_0, path: 'PathIdentity []', intervals: " - "{{{=C" - "onst [1]}} U {{=Const [2]}} U {{=Const [3]}}}, entryIndex: 0\n" + "{{{=Const [1]}} U {{=Const [2]}} U {{=Const [3]}}}, entryIndex: 0\n" "Scan [c1, {root}]\n", optimized); } @@ -5777,11 +5337,7 @@ TEST(PhysRewriter, EqMemberSargable) { "| type: Centralized\n" "| indexingRequirement: \n" "| Complete, dedupRID\n" - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "Properties [cost: 0.173038, localCost: 0.0180785, adjustedCE: 54.6819]\n" "| | Logical:\n" "| | cardinalityEstimate: \n" @@ -5831,8 +5387,6 @@ TEST(PhysRewriter, EqMemberSargable) { "| | repetitionEstimate: 54.6819\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "Properties [cost: 0.0791597, localCost: 0.0791597, adjustedCE: 18.2273]\n" "| | Logical:\n" "| | cardinalityEstimate: \n" @@ -5857,10 +5411,7 @@ TEST(PhysRewriter, EqMemberSargable) { "| type: Centralized\n" "| indexingRequirement: \n" "| Index, dedupRID\n" - "GroupBy []\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [rid_0]\n" + "GroupBy [{rid_0}]\n" "| aggregations: \n" "Union [{rid_0}]\n" "| | IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: " @@ -5934,13 +5485,7 @@ TEST(PhysRewriter, IndexSubfieldCovered) { // residual predicates. Also observe the traverse for "a.c" is removed due to "a" being // non-multikey. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| | pb\n" - "| RefBlock: \n" - "| Variable [pa]\n" - "| Variable [pb]\n" + "Root [{pa, pb}]\n" "Filter []\n" "| EvalFilter []\n" "| | Variable [pb]\n" @@ -6019,11 +5564,7 @@ TEST(PhysRewriter, PerfOnlyPreds1) { // Demonstrate predicates are repeated on the Seek side. Also demonstrate null handling, and the // fact that we apply the predicates on the Seek side in increasing selectivity order. ASSERT_EXPLAIN_V2Compact_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| RefBlock: \n" - "| Variable [pa]\n" + "Root [{pa}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| Filter []\n" @@ -6036,8 +5577,6 @@ TEST(PhysRewriter, PerfOnlyPreds1) { "| | PathCompare [Lt] Const [1]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'a': pa, 'b': evalTemp_3}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {[Const [2" " | minKey], Const [2 | 1])}]\n", optimized); @@ -6104,11 +5643,7 @@ TEST(PhysRewriter, PerfOnlyPreds2) { // Demonstrate an intersection plan, with predicates repeated on the Seek side. ASSERT_EXPLAIN_V2Compact_AUTO( - "Root []\n" - "| | projections: \n" - "| | pa\n" - "| RefBlock: \n" - "| Variable [pa]\n" + "Root [{pa}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| Filter []\n" @@ -6121,8 +5656,6 @@ TEST(PhysRewriter, PerfOnlyPreds2) { "| | PathCompare [Eq] Const [1]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'a': pa, 'b': evalTemp_2}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "MergeJoin []\n" "| | | Condition\n" "| | | rid_0 = rid_5\n" @@ -6187,11 +5720,7 @@ TEST(PhysRewriter, ConjunctionTraverseMultikey1) { // the original query. // But at the same time, the index should help satisfy one predicate or the other. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| Filter []\n" @@ -6203,8 +5732,6 @@ TEST(PhysRewriter, ConjunctionTraverseMultikey1) { "| | Const [1]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root, 'a': evalTemp_11}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "Unique []\n" "| projections: \n" "| rid_0\n" @@ -6257,11 +5784,7 @@ TEST(PhysRewriter, ConjunctionTraverseMultikey2) { // If we use the index to satisfy {a: 1} then we can't also use it to satisfy {'a.x': 1}, // because that would be forcing the same array element to match both predicates. ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | root\n" - "| RefBlock: \n" - "| Variable [root]\n" + "Root [{root}]\n" "NestedLoopJoin [joinType: Inner, {rid_0}]\n" "| | Const [true]\n" "| Filter []\n" @@ -6273,8 +5796,6 @@ TEST(PhysRewriter, ConjunctionTraverseMultikey2) { "| | Const [1]\n" "| LimitSkip [limit: 1, skip: 0]\n" "| Seek [ridProjection: rid_0, {'<root>': root, 'a': evalTemp_5}, c1]\n" - "| RefBlock: \n" - "| Variable [rid_0]\n" "IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {=Const [1" "]}]\n", optimized); diff --git a/src/mongo/db/query/optimizer/rewrites/path_optimizer_test.cpp b/src/mongo/db/query/optimizer/rewrites/path_optimizer_test.cpp index 3a717149888..d4414fc08a8 100644 --- a/src/mongo/db/query/optimizer/rewrites/path_optimizer_test.cpp +++ b/src/mongo/db/query/optimizer/rewrites/path_optimizer_test.cpp @@ -192,11 +192,7 @@ TEST(Path, Fuse3) { auto tree = make<RootNode>(properties::ProjectionRequirement{ProjectionNameVector{"y"}}, std::move(project2)); ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " y\n" - " RefBlock: \n" - " Variable [y]\n" + "Root [{y}]\n" " Evaluation [{y}]\n" " EvalPath []\n" " PathGet [a]\n" @@ -231,11 +227,7 @@ TEST(Path, Fuse3) { } while (changed); ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " y\n" - " RefBlock: \n" - " Variable [y]\n" + "Root [{y}]\n" " Evaluation [{y}]\n" " EvalPath []\n" " PathGet [z]\n" @@ -286,13 +278,7 @@ TEST(Path, Fuse4) { std::move(project2)); ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " x\n" - " y\n" - " RefBlock: \n" - " Variable [x]\n" - " Variable [y]\n" + "Root [{x, y}]\n" " Evaluation [{y}]\n" " EvalPath []\n" " PathGet [a]\n" @@ -345,13 +331,7 @@ TEST(Path, Fuse4) { } while (changed); ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " x\n" - " y\n" - " RefBlock: \n" - " Variable [x]\n" - " Variable [y]\n" + "Root [{x, y}]\n" " Evaluation [{y}]\n" " EvalPath []\n" " PathTraverse [inf]\n" @@ -408,11 +388,7 @@ TEST(Path, Fuse5) { std::move(filter)); ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " x\n" - " RefBlock: \n" - " Variable [x]\n" + "Root [{x}]\n" " Filter []\n" " EvalFilter []\n" " PathGet [a]\n" @@ -441,11 +417,7 @@ TEST(Path, Fuse5) { // The filter now refers directly to the root projection. ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " x\n" - " RefBlock: \n" - " Variable [x]\n" + "Root [{x}]\n" " Filter []\n" " EvalFilter []\n" " PathGet [a]\n" @@ -477,11 +449,7 @@ TEST(Path, Fuse6) { std::move(project)); ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " x\n" - " RefBlock: \n" - " Variable [x]\n" + "Root [{x}]\n" " Evaluation [{x}]\n" " EvalPath []\n" " PathComposeM []\n" @@ -509,11 +477,7 @@ TEST(Path, Fuse6) { // PathObj is removed. ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " x\n" - " RefBlock: \n" - " Variable [x]\n" + "Root [{x}]\n" " Evaluation [{x}]\n" " EvalPath []\n" " PathComposeM []\n" @@ -548,11 +512,7 @@ TEST(Path, Fuse7) { std::move(project2)); ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " py\n" - " RefBlock: \n" - " Variable [py]\n" + "Root [{py}]\n" " Evaluation [{py}]\n" " EvalPath []\n" " PathComposeM []\n" @@ -586,11 +546,7 @@ TEST(Path, Fuse7) { // Obtain "x" and directly assign at "a". ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " py\n" - " RefBlock: \n" - " Variable [py]\n" + "Root [{py}]\n" " Evaluation [{py}]\n" " EvalPath []\n" " PathField [a]\n" @@ -719,11 +675,7 @@ TEST(Path, ProjElim1) { runPathLowering(env, prefixId, tree); ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " y\n" - " RefBlock: \n" - " Variable [y]\n" + "Root [{y}]\n" " Evaluation [{y}]\n" " FunctionCall [anyFunctionWillDo]\n" " Variable [root]\n" @@ -750,8 +702,6 @@ TEST(Path, ProjElim2) { ASSERT_EXPLAIN_AUTO( "Root []\n" - " projections: \n" - " RefBlock: \n" " Scan [test, {root}]\n", tree); } @@ -784,11 +734,7 @@ TEST(Path, ProjElim3) { } while (changed); ASSERT_EXPLAIN_AUTO( - "Root []\n" - " projections: \n" - " p99\n" - " RefBlock: \n" - " Variable [p99]\n" + "Root [{p99}]\n" " Evaluation [{p99}]\n" " Variable [root]\n" " Scan [test, {root}]\n", diff --git a/src/mongo/db/query/optimizer/unit_test_infra_test.cpp b/src/mongo/db/query/optimizer/unit_test_infra_test.cpp index 18ee6394fb9..881a2665861 100644 --- a/src/mongo/db/query/optimizer/unit_test_infra_test.cpp +++ b/src/mongo/db/query/optimizer/unit_test_infra_test.cpp @@ -160,15 +160,8 @@ TEST(TestInfra, ABTLiterals) { auto rootNode = _root("pc")(std::move(groupByNode)); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pc\n" - "| RefBlock: \n" - "| Variable [pc]\n" - "GroupBy []\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [pa]\n" + "Root [{pc}]\n" + "GroupBy [{pa}]\n" "| aggregations: \n" "| [pc]\n" "| Variable [pb]\n" @@ -206,15 +199,8 @@ TEST(TestInfra, ABTLiterals) { .finish(_scan("root", "c1")); ASSERT_EXPLAIN_V2_AUTO( - "Root []\n" - "| | projections: \n" - "| | pc\n" - "| RefBlock: \n" - "| Variable [pc]\n" - "GroupBy []\n" - "| | groupings: \n" - "| | RefBlock: \n" - "| | Variable [pa]\n" + "Root [{pc}]\n" + "GroupBy [{pa}]\n" "| aggregations: \n" "| [pc]\n" "| Variable [pb]\n" diff --git a/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_collation_node.txt b/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_collation_node.txt index 53c519bc24f..4cb1ae42e3e 100644 --- a/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_collation_node.txt +++ b/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_collation_node.txt @@ -13,8 +13,6 @@ Filter [] Collation [] | | collation: | | sortA: Ascending -| RefBlock: -| Variable [sortA] Evaluation [{proj1}] | FunctionCall [getField] | | Const ["c"] @@ -51,9 +49,6 @@ Collation [] | | collation: | | sortA: Ascending | | sortB: Descending -| RefBlock: -| Variable [sortA] -| Variable [sortB] Evaluation [{proj0}] | FunctionCall [getField] | | Const ["c"] diff --git a/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_exchange_node.txt b/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_exchange_node.txt index 0ac43d17d2d..a3a558b567b 100644 --- a/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_exchange_node.txt +++ b/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_exchange_node.txt @@ -7,8 +7,6 @@ Exchange [] | | type: HashPartitioning | | projections: | | proj0 -| RefBlock: -| Variable [proj0] Evaluation [{proj1}] | FunctionCall [getField] | | Const ["a"] @@ -32,8 +30,6 @@ Exchange [] | | type: Centralized | | projections: | | proj0 -| RefBlock: -| Variable [proj0] Evaluation [{proj1}] | FunctionCall [getField] | | Const ["a"] @@ -57,8 +53,6 @@ Exchange [] | | type: RoundRobin | | projections: | | proj0 -| RefBlock: -| Variable [proj0] Evaluation [{proj1}] | FunctionCall [getField] | | Const ["a"] @@ -82,8 +76,6 @@ Exchange [] | | type: Replicated | | projections: | | proj0 -| RefBlock: -| Variable [proj0] Evaluation [{proj1}] | FunctionCall [getField] | | Const ["a"] diff --git a/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_group_by_node.txt b/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_group_by_node.txt index 4bba1f572ee..197ee0d6108 100644 --- a/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_group_by_node.txt +++ b/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_group_by_node.txt @@ -2,11 +2,7 @@ ==== VARIATION: GroupByNode one output with type Complete ==== -- INPUT: -GroupBy [] -| | groupings: -| | RefBlock: -| | Variable [key1] -| | Variable [key2] +GroupBy [{key1, key2}] | aggregations: | [outFunc1] | FunctionCall [$sum] @@ -34,11 +30,7 @@ PhysicalScan [{'<root>': scan0}, collName] ==== VARIATION: GroupByNode multiple outputs with type Complete ==== -- INPUT: -GroupBy [] -| | groupings: -| | RefBlock: -| | Variable [key1] -| | Variable [key2] +GroupBy [{key1, key2}] | aggregations: | [outFunc1] | FunctionCall [$sum] @@ -74,11 +66,7 @@ PhysicalScan [{'<root>': scan0}, collName] ==== VARIATION: GroupByNode one output with type Local ==== -- INPUT: -GroupBy [Local] -| | groupings: -| | RefBlock: -| | Variable [key1] -| | Variable [key2] +GroupBy [{key1, key2}, Local] | aggregations: | [outFunc1] | FunctionCall [$sum] @@ -106,11 +94,7 @@ PhysicalScan [{'<root>': scan0}, collName] ==== VARIATION: GroupByNode multiple outputs with type Local ==== -- INPUT: -GroupBy [Local] -| | groupings: -| | RefBlock: -| | Variable [key1] -| | Variable [key2] +GroupBy [{key1, key2}, Local] | aggregations: | [outFunc1] | FunctionCall [$sum] @@ -146,11 +130,7 @@ PhysicalScan [{'<root>': scan0}, collName] ==== VARIATION: GroupByNode one output with type Global ==== -- INPUT: -GroupBy [Global] -| | groupings: -| | RefBlock: -| | Variable [key1] -| | Variable [key2] +GroupBy [{key1, key2}, Global] | aggregations: | [outFunc1] | FunctionCall [$sum] @@ -178,11 +158,7 @@ PhysicalScan [{'<root>': scan0}, collName] ==== VARIATION: GroupByNode multiple outputs with type Global ==== -- INPUT: -GroupBy [Global] -| | groupings: -| | RefBlock: -| | Variable [key1] -| | Variable [key2] +GroupBy [{key1, key2}, Global] | aggregations: | [outFunc1] | FunctionCall [$sum] diff --git a/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_seek_node.txt b/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_seek_node.txt index 2eeb6d52490..5835285d233 100644 --- a/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_seek_node.txt +++ b/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_seek_node.txt @@ -6,8 +6,6 @@ NestedLoopJoin [joinType: Inner, {rid}] | | Const [true] | LimitSkip [limit: 1, skip: 0] | Seek [ridProjection: rid, {'<root>': scan0}, collName] -| RefBlock: -| Variable [rid] IndexScan [{'<rid>': rid}, scanDefName: collName, indexDefName: index0, interval: {(Const [23], Const [35]]}] -- OUTPUT: diff --git a/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_unwind_node.txt b/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_unwind_node.txt index 3186bc9c071..f18a29a7df0 100644 --- a/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_unwind_node.txt +++ b/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_unwind_node.txt @@ -2,7 +2,7 @@ ==== VARIATION: Lower UnwindNode discard non-arrays ==== -- INPUT: -Unwind [] +Unwind [{proj0, proj0_pid}] Evaluation [{proj0}] | FunctionCall [getField] | | Const ["a"] @@ -16,7 +16,7 @@ PhysicalScan [{'<root>': scan0}, collName] ==== VARIATION: Lower UnwindNode keep non-arrays ==== -- INPUT: -Unwind [retainNonArrays] +Unwind [{proj0, proj0_pid}, retainNonArrays] Evaluation [{proj0}] | FunctionCall [getField] | | Const ["a"] diff --git a/src/mongo/db/test_output/pipeline/abt/a_b_t_optimization_test/optimize_pipeline_tests.txt b/src/mongo/db/test_output/pipeline/abt/a_b_t_optimization_test/optimize_pipeline_tests.txt index 97dd322d6b2..615a43b75da 100644 --- a/src/mongo/db/test_output/pipeline/abt/a_b_t_optimization_test/optimize_pipeline_tests.txt +++ b/src/mongo/db/test_output/pipeline/abt/a_b_t_optimization_test/optimize_pipeline_tests.txt @@ -32,11 +32,7 @@ optimization phases: MemoSubstitutionPhase -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Sargable [Complete] | | | | requirementsMap: | | | | refProjection: scan_0, path: 'PathGet [a] PathTraverse [1] PathIdentity []', intervals: {{{=Const [1]}} U {{=Const [2]}} U {{=Const [3]}}} @@ -83,11 +79,7 @@ optimization phases: MemoSubstitutionPhase -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Sargable [Complete] | | | | requirementsMap: | | | | refProjection: scan_0, path: 'PathGet [a] PathTraverse [1] PathIdentity []', intervals: {{{=Const [1]}} U {{=Const [2]}} U {{=Const [3]}}} @@ -122,11 +114,7 @@ optimization phases: PathFuse -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Const [{}] @@ -170,11 +158,7 @@ optimization phases: MemoSubstitutionPhase -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [evalTemp_3] @@ -208,11 +192,7 @@ optimization phases: ConstEvalPre -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Variable [scan_0] @@ -261,15 +241,10 @@ optimization phases: MemoSubstitutionPhase -- OUTPUT: -Root [] -| | projections: -| | agg_project_0 -| RefBlock: -| Variable [agg_project_0] +Root [{agg_project_0}] Exchange [] | | distribution: | | type: Centralized -| RefBlock: Evaluation [{agg_project_0}] | EvalPath [] | | Const [{}] @@ -280,10 +255,7 @@ Evaluation [{agg_project_0}] | PathField [_id] | PathConstant [] | Variable [groupByProj_0] -GroupBy [Global] -| | groupings: -| | RefBlock: -| | Variable [groupByProj_0] +GroupBy [{groupByProj_0}, Global] | aggregations: | [field_agg_0] | FunctionCall [$sum] @@ -293,12 +265,7 @@ Exchange [] | | type: HashPartitioning | | projections: | | groupByProj_0 -| RefBlock: -| Variable [groupByProj_0] -GroupBy [Local] -| | groupings: -| | RefBlock: -| | Variable [groupByProj_0] +GroupBy [{groupByProj_0}, Local] | aggregations: | [preagg_0] | FunctionCall [$sum] @@ -330,16 +297,10 @@ optimization phases: PathLower -- OUTPUT: -Root [] -| | projections: -| | embedProj_0 -| RefBlock: -| Variable [embedProj_0] +Root [{embedProj_0}] Collation [] | | collation: | | sort_0: Ascending -| RefBlock: -| Variable [sort_0] Evaluation [{sort_0}] | Variable [unwoundProj_0] Evaluation [{embedProj_0}] @@ -354,7 +315,7 @@ Evaluation [{embedProj_0}] | | Variable [scan_0] | FunctionCall [exists] | Variable [unwoundProj_0] -Unwind [] +Unwind [{unwoundProj_0, unwoundPid_0}] PhysicalScan [{'<root>': scan_0, 'x': unwoundProj_0}, collection] @@ -394,17 +355,11 @@ optimization phases: MemoSubstitutionPhase -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] NestedLoopJoin [joinType: Inner, {rid_0}] | | Const [true] | LimitSkip [limit: 1, skip: 0] | Seek [ridProjection: rid_0, {'<root>': scan_0}, collection] -| RefBlock: -| Variable [rid_0] IndexScan [{'<rid>': rid_0}, scanDefName: collection, indexDefName: index1, interval: {=Const [10]}] @@ -445,11 +400,7 @@ optimization phases: PathFuse -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Const [{}] @@ -496,11 +447,7 @@ optimization phases: PathFuse -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Const [{}] @@ -552,11 +499,7 @@ optimization phases: PathFuse -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Const [{}] @@ -613,11 +556,7 @@ optimization phases: PathFuse -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Const [{}] @@ -682,11 +621,7 @@ optimization phases: PathFuse -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Const [{}] @@ -740,22 +675,14 @@ optimization phases: MemoSubstitutionPhase -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Collation [] | | collation: | | sort_0: Ascending -| RefBlock: -| Variable [sort_0] NestedLoopJoin [joinType: Inner, {rid_0}] | | Const [true] | LimitSkip [limit: 1, skip: 0] | Seek [ridProjection: rid_0, {'<root>': scan_0, 'a': sort_0}, collection] -| RefBlock: -| Variable [rid_0] IndexScan [{'<rid>': rid_0}, scanDefName: collection, indexDefName: index1, interval: {=Const [10]}] @@ -795,27 +722,18 @@ optimization phases: MemoSubstitutionPhase -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] NestedLoopJoin [joinType: Inner, {rid_0}] | | Const [true] | LimitSkip [limit: 1, skip: 0] | Seek [ridProjection: rid_0, {'<root>': scan_0}, collection] -| RefBlock: -| Variable [rid_0] Filter [] | EvalFilter [] | | FunctionCall [getArraySize] | | Variable [sides_0] | PathCompare [Eq] | Const [2] -GroupBy [] -| | groupings: -| | RefBlock: -| | Variable [rid_0] +GroupBy [{rid_0}] | aggregations: | [sides_0] | FunctionCall [$addToSet] @@ -871,17 +789,11 @@ optimization phases: MemoSubstitutionPhase -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] NestedLoopJoin [joinType: Inner, {rid_0}] | | Const [true] | LimitSkip [limit: 1, skip: 0] | Seek [ridProjection: rid_0, {'<root>': scan_0}, collection] -| RefBlock: -| Variable [rid_0] IndexScan [{'<rid>': rid_0}, scanDefName: collection, indexDefName: index1, interval: {=Const [2 | 2]}] @@ -922,11 +834,7 @@ optimization phases: MemoSubstitutionPhase -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] NestedLoopJoin [joinType: Inner, {rid_0}] | | Const [true] | Filter [] @@ -937,8 +845,6 @@ NestedLoopJoin [joinType: Inner, {rid_0}] | | Const [2] | LimitSkip [limit: 1, skip: 0] | Seek [ridProjection: rid_0, {'<root>': scan_0, 'b': evalTemp_4}, collection] -| RefBlock: -| Variable [rid_0] IndexScan [{'<rid>': rid_0}, scanDefName: collection, indexDefName: index1, interval: {=Const [2]}] @@ -966,11 +872,7 @@ optimization phases: PathLower -- OUTPUT: -Root [] -| | projections: -| | agg_project_0 -| RefBlock: -| Variable [agg_project_0] +Root [{agg_project_0}] Evaluation [{agg_project_0}] | Let [inputField_1] | | If [] @@ -995,10 +897,7 @@ Evaluation [{agg_project_0}] | | Const [{}] | FunctionCall [exists] | Variable [groupByProj_0] -GroupBy [] -| | groupings: -| | RefBlock: -| | Variable [groupByProj_0] +GroupBy [{groupByProj_0}] | aggregations: | [field_agg_0] | FunctionCall [$first] @@ -1036,11 +935,7 @@ optimization phases: MemoSubstitutionPhase -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Union [{scan_0}] | Filter [] | | EvalFilter [] @@ -1081,11 +976,7 @@ optimization phases: ConstEvalPre -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Variable [scan_0] @@ -1133,11 +1024,7 @@ optimization phases: PathFuse -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_1 -| RefBlock: -| Variable [combinedProjection_1] +Root [{combinedProjection_1}] Evaluation [{combinedProjection_1}] | EvalPath [] | | Const [{}] @@ -1147,10 +1034,7 @@ Evaluation [{combinedProjection_1}] | | FunctionCall [getArraySize] | | Variable [field_agg_0] | PathKeep [] -GroupBy [] -| | groupings: -| | RefBlock: -| | Variable [groupByProj_0] +GroupBy [{groupByProj_0}] | aggregations: | [field_agg_0] | FunctionCall [$addToSet] @@ -1178,11 +1062,7 @@ optimization phases: MemoSubstitutionPhase -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Sargable [Complete] | | | | requirementsMap: | | | | refProjection: scan_0, path: 'PathGet [a] PathIdentity []', intervals: {{{[Const [[]], Const [BinData(0, )])}}} diff --git a/src/mongo/db/test_output/pipeline/abt/a_b_t_optimization_test/partial_index.txt b/src/mongo/db/test_output/pipeline/abt/a_b_t_optimization_test/partial_index.txt index 83219578262..85ac65bbff5 100644 --- a/src/mongo/db/test_output/pipeline/abt/a_b_t_optimization_test/partial_index.txt +++ b/src/mongo/db/test_output/pipeline/abt/a_b_t_optimization_test/partial_index.txt @@ -39,11 +39,7 @@ optimization phases: PathLower -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] NestedLoopJoin [joinType: Inner, {rid_0}] | | Const [true] | Filter [] @@ -58,8 +54,6 @@ NestedLoopJoin [joinType: Inner, {rid_0}] | | Variable [evalTemp_4] | LimitSkip [limit: 1, skip: 0] | Seek [ridProjection: rid_0, {'<root>': scan_0, 'b': evalTemp_4}, collection] -| RefBlock: -| Variable [rid_0] IndexScan [{'<rid>': rid_0}, scanDefName: collection, indexDefName: index1, interval: {=Const [3]}] @@ -104,11 +98,7 @@ optimization phases: PathLower -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | BinaryOp [FillEmpty] | | Const [false] diff --git a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/and_or_translation.txt b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/and_or_translation.txt index 4a961ffad2e..f55a78c4db1 100644 --- a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/and_or_translation.txt +++ b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/and_or_translation.txt @@ -14,11 +14,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] @@ -52,11 +48,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] @@ -88,11 +80,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] diff --git a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/computed_projection_translation.txt b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/computed_projection_translation.txt index 4517b130bc7..4e5ac46063f 100644 --- a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/computed_projection_translation.txt +++ b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/computed_projection_translation.txt @@ -14,11 +14,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Variable [scan_0] @@ -52,11 +48,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Variable [scan_0] @@ -96,11 +88,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Variable [scan_0] @@ -148,11 +136,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Variable [scan_0] @@ -192,11 +176,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | newRoot_0 -| RefBlock: -| Variable [newRoot_0] +Root [{newRoot_0}] Evaluation [{newRoot_0}] | EvalPath [] | | Variable [scan_0] @@ -221,11 +201,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Variable [scan_0] diff --git a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/elem_match_translation.txt b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/elem_match_translation.txt index c2f50b2396e..0c6d127bdf4 100644 --- a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/elem_match_translation.txt +++ b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/elem_match_translation.txt @@ -14,11 +14,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] @@ -54,11 +50,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] @@ -89,11 +81,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Filter [] | EvalFilter [] | | Variable [combinedProjection_0] @@ -147,11 +135,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] diff --git a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/eq_translation.txt b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/eq_translation.txt index 1bb8ff73482..0d85d73b9bb 100644 --- a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/eq_translation.txt +++ b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/eq_translation.txt @@ -14,11 +14,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] @@ -45,11 +41,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] @@ -81,11 +73,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] diff --git a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/exists_translation.txt b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/exists_translation.txt index 73ba58e137c..09d46b1afa6 100644 --- a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/exists_translation.txt +++ b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/exists_translation.txt @@ -14,11 +14,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] @@ -44,11 +40,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] @@ -78,11 +70,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] diff --git a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/group_translation.txt b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/group_translation.txt index d4d5a940710..3b141a73084 100644 --- a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/group_translation.txt +++ b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/group_translation.txt @@ -14,11 +14,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Filter [] | EvalFilter [] | | Variable [combinedProjection_0] @@ -74,11 +70,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | agg_project_0 -| RefBlock: -| Variable [agg_project_0] +Root [{agg_project_0}] Evaluation [{agg_project_0}] | EvalPath [] | | Const [{}] @@ -89,10 +81,7 @@ Evaluation [{agg_project_0}] | PathField [_id] | PathConstant [] | Variable [groupByProj_0] -GroupBy [] -| | groupings: -| | RefBlock: -| | Variable [groupByProj_0] +GroupBy [{groupByProj_0}] | aggregations: | [field_agg_0] | FunctionCall [$sum] @@ -133,11 +122,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | agg_project_0 -| RefBlock: -| Variable [agg_project_0] +Root [{agg_project_0}] Evaluation [{agg_project_0}] | EvalPath [] | | Const [{}] @@ -148,10 +133,7 @@ Evaluation [{agg_project_0}] | PathField [_id] | PathConstant [] | Variable [groupByProj_0] -GroupBy [] -| | groupings: -| | RefBlock: -| | Variable [groupByProj_0] +GroupBy [{groupByProj_0}] | aggregations: | [field_agg_0] | FunctionCall [$sum] @@ -185,11 +167,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | agg_project_0 -| RefBlock: -| Variable [agg_project_0] +Root [{agg_project_0}] Evaluation [{agg_project_0}] | EvalPath [] | | Const [{}] @@ -209,11 +187,7 @@ Evaluation [{agg_project_0}] | PathField [isin] | PathConstant [] | Variable [groupByProj_0] -GroupBy [] -| | groupings: -| | RefBlock: -| | Variable [groupByProj_0] -| | Variable [groupByProj_1] +GroupBy [{groupByProj_0, groupByProj_1}] | aggregations: | [field_agg_0] | FunctionCall [$sum] diff --git a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/in_translation.txt b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/in_translation.txt index 0b9fb117926..05cb5c9f224 100644 --- a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/in_translation.txt +++ b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/in_translation.txt @@ -14,11 +14,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] @@ -43,11 +39,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] @@ -74,11 +66,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] @@ -105,11 +93,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] diff --git a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/inequality_translation.txt b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/inequality_translation.txt index 65df571b159..83c3c47cbff 100644 --- a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/inequality_translation.txt +++ b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/inequality_translation.txt @@ -14,11 +14,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] @@ -48,11 +44,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] diff --git a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/not_translation.txt b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/not_translation.txt index e59a5acfa23..bf41193d80c 100644 --- a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/not_translation.txt +++ b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/not_translation.txt @@ -14,11 +14,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] @@ -48,11 +44,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] @@ -83,11 +75,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] diff --git a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/simple_projection_translation.txt b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/simple_projection_translation.txt index ac27c3ad999..17512bc1c01 100644 --- a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/simple_projection_translation.txt +++ b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/simple_projection_translation.txt @@ -14,11 +14,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Variable [scan_0] @@ -42,11 +38,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Variable [scan_0] @@ -76,11 +68,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Variable [scan_0] @@ -104,11 +92,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | combinedProjection_0 -| RefBlock: -| Variable [combinedProjection_0] +Root [{combinedProjection_0}] Evaluation [{combinedProjection_0}] | EvalPath [] | | Variable [scan_0] diff --git a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/sort_translation.txt b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/sort_translation.txt index 55be55d1bf1..f4f566d2666 100644 --- a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/sort_translation.txt +++ b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/sort_translation.txt @@ -14,18 +14,11 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Collation [] | | collation: | | sort_0: Ascending | | sort_1: Descending -| RefBlock: -| Variable [sort_0] -| Variable [sort_1] Evaluation [{sort_1}] | EvalPath [] | | Variable [scan_0] @@ -57,16 +50,10 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Collation [] | | collation: | | sort_0: Ascending -| RefBlock: -| Variable [sort_0] Evaluation [{sort_0}] | EvalPath [] | | Variable [scan_0] diff --git a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/union_translation.txt b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/union_translation.txt index ba611d20149..8d9aac181d0 100644 --- a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/union_translation.txt +++ b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/union_translation.txt @@ -22,11 +22,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | scan_0 -| RefBlock: -| Variable [scan_0] +Root [{scan_0}] Filter [] | EvalFilter [] | | Variable [scan_0] diff --git a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/unwind_translation.txt b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/unwind_translation.txt index a0231d15ee8..67aebdbe852 100644 --- a/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/unwind_translation.txt +++ b/src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/unwind_translation.txt @@ -14,11 +14,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | embedProj_0 -| RefBlock: -| Variable [embedProj_0] +Root [{embedProj_0}] Evaluation [{embedProj_0}] | EvalPath [] | | Variable [scan_0] @@ -29,7 +25,7 @@ Evaluation [{embedProj_0}] | PathField [c] | PathConstant [] | Variable [unwoundProj_0] -Unwind [] +Unwind [{unwoundProj_0, unwoundPid_0}] Evaluation [{unwoundProj_0}] | EvalPath [] | | Variable [scan_0] @@ -56,11 +52,7 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | embedPidProj_0 -| RefBlock: -| Variable [embedPidProj_0] +Root [{embedPidProj_0}] Evaluation [{embedPidProj_0}] | EvalPath [] | | Variable [embedProj_0] @@ -89,7 +81,7 @@ Evaluation [{embedProj_0}] | BinaryOp [Gte] | | Const [0] | Variable [unwoundPid_0] -Unwind [retainNonArrays] +Unwind [{unwoundProj_0, unwoundPid_0}, retainNonArrays] Evaluation [{unwoundProj_0}] | EvalPath [] | | Variable [scan_0] @@ -116,21 +108,14 @@ metadata: CE type: -1 -- OUTPUT: -Root [] -| | projections: -| | agg_project_0 -| RefBlock: -| Variable [agg_project_0] +Root [{agg_project_0}] Evaluation [{agg_project_0}] | EvalPath [] | | Const [{}] | PathField [_id] | PathConstant [] | Variable [groupByProj_0] -GroupBy [] -| | groupings: -| | RefBlock: -| | Variable [groupByProj_0] +GroupBy [{groupByProj_0}] | aggregations: Evaluation [{groupByProj_0}] | EvalPath [] @@ -153,7 +138,7 @@ Evaluation [{embedProj_0}] | BinaryOp [Gte] | | Const [0] | Variable [unwoundPid_0] -Unwind [retainNonArrays] +Unwind [{unwoundProj_0, unwoundPid_0}, retainNonArrays] Evaluation [{unwoundProj_0}] | EvalPath [] | | Variable [scan_0] |