summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Boros <matt.boros@mongodb.com>2023-02-07 00:19:57 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-07 00:56:27 +0000
commit3229175bb05be607fab3bef19e4ce1b17ab6f0e4 (patch)
tree717c03a32f952fcbb8e8af7b4015412acd7a13ef
parent1b475ef190b29cb62d9a205a05bde1d2ddb6332b (diff)
downloadmongo-3229175bb05be607fab3bef19e4ce1b17ab6f0e4.tar.gz
SERVER-72226 Shorten LimitSkip explain
-rw-r--r--src/mongo/db/exec/sbe/abt/sbe_abt_test.cpp5
-rw-r--r--src/mongo/db/query/cost_model/cost_model_test.cpp5
-rw-r--r--src/mongo/db/query/optimizer/explain.cpp31
-rw-r--r--src/mongo/db/query/optimizer/interval_simplify_test.cpp55
-rw-r--r--src/mongo/db/query/optimizer/logical_rewriter_optimizer_test.cpp15
-rw-r--r--src/mongo/db/query/optimizer/optimizer_test.cpp12
-rw-r--r--src/mongo/db/query/optimizer/physical_rewriter_optimizer_test.cpp220
-rw-r--r--src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_limit_skip_node.txt15
-rw-r--r--src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_seek_node.txt5
-rw-r--r--src/mongo/db/test_output/pipeline/abt/a_b_t_optimization_test/optimize_pipeline_tests.txt25
-rw-r--r--src/mongo/db/test_output/pipeline/abt/a_b_t_optimization_test/partial_index.txt5
-rw-r--r--src/mongo/db/test_output/pipeline/abt/a_b_t_translation_test/sort_translation.txt10
12 files changed, 100 insertions, 303 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 bca930f04d9..eef9762af01 100644
--- a/src/mongo/db/exec/sbe/abt/sbe_abt_test.cpp
+++ b/src/mongo/db/exec/sbe/abt/sbe_abt_test.cpp
@@ -787,10 +787,7 @@ TEST_F(NodeSBE, SpoolFibonacci) {
"| Const [0]\n"
"Evaluation [{it}]\n"
"| Const [1]\n"
- "LimitSkip []\n"
- "| limitSkip:\n"
- "| limit: 1\n"
- "| skip: 0\n"
+ "LimitSkip [limit: 1, skip: 0]\n"
"CoScan []\n",
tree);
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 af6e2cfa4e5..5dba614a7eb 100644
--- a/src/mongo/db/query/cost_model/cost_model_test.cpp
+++ b/src/mongo/db/query/cost_model/cost_model_test.cpp
@@ -80,10 +80,7 @@ TEST(CostModel, IncreaseIndexScanCost) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
diff --git a/src/mongo/db/query/optimizer/explain.cpp b/src/mongo/db/query/optimizer/explain.cpp
index af36021acbf..4e134b83104 100644
--- a/src/mongo/db/query/optimizer/explain.cpp
+++ b/src/mongo/db/query/optimizer/explain.cpp
@@ -165,12 +165,12 @@ public:
return print(other);
}
- ExplainPrinterImpl& setChildCount(const size_t childCount) {
+ ExplainPrinterImpl& setChildCount(const size_t childCount, const bool noInline = false) {
if (version == ExplainVersion::V1) {
return *this;
}
- if (version == ExplainVersion::V2Compact && childCount == 1) {
+ if (!noInline && version == ExplainVersion::V2Compact && childCount == 1) {
_inlineNextChild = true;
_childrenRemaining = childCount;
return *this;
@@ -1906,11 +1906,30 @@ public:
ExplainPrinter transport(const ABT& n, const LimitSkipNode& node, ExplainPrinter childResult) {
ExplainPrinter printer("LimitSkip");
maybePrintProps(printer, node);
- printer.separator(" []");
- nodeCEPropsPrint(printer, n, node);
+ printer.separator(" [");
+
+ // If we have version < V3, inline the limit skip.
+ if constexpr (version < ExplainVersion::V3) {
+ const auto& prop = node.getProperty();
+ printer.fieldName("limit");
+ if (prop.hasLimit()) {
+ printer.print(prop.getLimit());
+ } else {
+ printer.print("(none)");
+ }
+ printer.separator(", ").fieldName("skip").print(prop.getSkip()).separator("]");
+ nodeCEPropsPrint(printer, n, node);
+ // Do not inline LimitSkip, since it's not a path.
+ printer.setChildCount(1, true /*noInline*/);
+ } else if (version == ExplainVersion::V3) {
+ printer.separator("]");
+ nodeCEPropsPrint(printer, n, node);
+ printer.setChildCount(2);
+ printLimitSkipProperty(printer, node.getProperty(), false /*directToParent*/);
+ } else {
+ MONGO_UNREACHABLE;
+ }
- printer.setChildCount(2);
- printLimitSkipProperty(printer, node.getProperty(), false /*directToParent*/);
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 60073c60baa..e50f4383c0d 100644
--- a/src/mongo/db/query/optimizer/interval_simplify_test.cpp
+++ b/src/mongo/db/query/optimizer/interval_simplify_test.cpp
@@ -85,10 +85,7 @@ TEST_F(IntervalIntersection, SingleFieldIntersection) {
"| Variable [scan_0]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': scan_0}, coll]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -105,10 +102,7 @@ TEST_F(IntervalIntersection, SingleFieldIntersection) {
"| Variable [scan_0]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': scan_0}, coll]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -127,10 +121,7 @@ TEST_F(IntervalIntersection, SingleFieldIntersection) {
"| Variable [scan_0]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': scan_0}, coll]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -156,10 +147,7 @@ TEST_F(IntervalIntersection, SingleFieldIntersection) {
"| Variable [scan_0]\n"
"Evaluation [{scan_0}]\n"
"| Const [Nothing]\n"
- "LimitSkip []\n"
- "| limitSkip:\n"
- "| limit: 0\n"
- "| skip: 0\n"
+ "LimitSkip [limit: 0, skip: 0]\n"
"CoScan []\n",
optimizedQueryPlan(q4Text, testIndex));
@@ -175,10 +163,7 @@ TEST_F(IntervalIntersection, SingleFieldIntersection) {
"| Variable [scan_0]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': scan_0}, coll]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -198,10 +183,7 @@ TEST_F(IntervalIntersection, SingleFieldIntersection) {
"| Variable [scan_0]\n"
"Evaluation [{scan_0}]\n"
"| Const [Nothing]\n"
- "LimitSkip []\n"
- "| limitSkip:\n"
- "| limit: 0\n"
- "| skip: 0\n"
+ "LimitSkip [limit: 0, skip: 0]\n"
"CoScan []\n",
optimizedQueryPlan(q6Text, testIndex));
@@ -217,10 +199,7 @@ TEST_F(IntervalIntersection, SingleFieldIntersection) {
"| Variable [scan_0]\n"
"Evaluation [{scan_0}]\n"
"| Const [Nothing]\n"
- "LimitSkip []\n"
- "| limitSkip:\n"
- "| limit: 0\n"
- "| skip: 0\n"
+ "LimitSkip [limit: 0, skip: 0]\n"
"CoScan []\n",
optimizedQueryPlan(q7Text, testIndex));
}
@@ -244,10 +223,7 @@ TEST_F(IntervalIntersection, MultiFieldIntersection) {
"| Variable [scan_0]\n"
"Evaluation [{scan_0}]\n"
"| Const [Nothing]\n"
- "LimitSkip []\n"
- "| limitSkip:\n"
- "| limit: 0\n"
- "| skip: 0\n"
+ "LimitSkip [limit: 0, skip: 0]\n"
"CoScan []\n",
optimizedQueryPlan(q1Text, testIndex));
@@ -261,10 +237,7 @@ TEST_F(IntervalIntersection, MultiFieldIntersection) {
"| Variable [scan_0]\n"
"Evaluation [{scan_0}]\n"
"| Const [Nothing]\n"
- "LimitSkip []\n"
- "| limitSkip:\n"
- "| limit: 0\n"
- "| skip: 0\n"
+ "LimitSkip [limit: 0, skip: 0]\n"
"CoScan []\n",
optimizedQueryPlan(q2Text, testIndex));
@@ -278,10 +251,7 @@ TEST_F(IntervalIntersection, MultiFieldIntersection) {
"| Variable [scan_0]\n"
"Evaluation [{scan_0}]\n"
"| Const [Nothing]\n"
- "LimitSkip []\n"
- "| limitSkip:\n"
- "| limit: 0\n"
- "| skip: 0\n"
+ "LimitSkip [limit: 0, skip: 0]\n"
"CoScan []\n",
optimizedQueryPlan(q3Text, testIndex));
@@ -294,10 +264,7 @@ TEST_F(IntervalIntersection, MultiFieldIntersection) {
"| Variable [scan_0]\n"
"Evaluation [{scan_0}]\n"
"| Const [Nothing]\n"
- "LimitSkip []\n"
- "| limitSkip:\n"
- "| limit: 0\n"
- "| skip: 0\n"
+ "LimitSkip [limit: 0, skip: 0]\n"
"CoScan []\n",
optimizedQueryPlan(q4Text, testIndex));
}
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 c50787889b1..ee40c054e29 100644
--- a/src/mongo/db/query/optimizer/logical_rewriter_optimizer_test.cpp
+++ b/src/mongo/db/query/optimizer/logical_rewriter_optimizer_test.cpp
@@ -60,14 +60,8 @@ TEST(LogicalRewriter, RootNodeMerge) {
" a\n"
" RefBlock: \n"
" Variable [a]\n"
- " LimitSkip []\n"
- " limitSkip:\n"
- " limit: 5\n"
- " skip: 0\n"
- " LimitSkip []\n"
- " limitSkip:\n"
- " limit: (none)\n"
- " skip: 10\n"
+ " LimitSkip [limit: 5, skip: 0]\n"
+ " LimitSkip [limit: (none), skip: 10]\n"
" Scan [test, {a}]\n",
rootNode);
@@ -85,10 +79,7 @@ TEST(LogicalRewriter, RootNodeMerge) {
" a\n"
" RefBlock: \n"
" Variable [a]\n"
- " LimitSkip []\n"
- " limitSkip:\n"
- " limit: 5\n"
- " skip: 10\n"
+ " LimitSkip [limit: 5, skip: 10]\n"
" Scan [test, {a}]\n",
rewritten);
}
diff --git a/src/mongo/db/query/optimizer/optimizer_test.cpp b/src/mongo/db/query/optimizer/optimizer_test.cpp
index c2464d0029c..e5c27f26d55 100644
--- a/src/mongo/db/query/optimizer/optimizer_test.cpp
+++ b/src/mongo/db/query/optimizer/optimizer_test.cpp
@@ -252,11 +252,8 @@ TEST(Optimizer, CoScan) {
VariableEnvironment venv = VariableEnvironment::build(limitNode);
ASSERT_TRUE(!venv.hasFreeVariables());
- ASSERT_EXPLAIN(
- "LimitSkip []\n"
- " limitSkip:\n"
- " limit: 1\n"
- " skip: 0\n"
+ ASSERT_EXPLAIN_AUTO(
+ "LimitSkip [limit: 1, skip: 0]\n"
" CoScan []\n",
limitNode);
}
@@ -563,10 +560,7 @@ TEST(Optimizer, LimitSkip) {
}
ASSERT_EXPLAIN_AUTO(
- "LimitSkip []\n"
- " limitSkip:\n"
- " limit: 10\n"
- " skip: 20\n"
+ "LimitSkip [limit: 10, skip: 20]\n"
" Evaluation [{b}]\n"
" EvalPath []\n"
" PathConstant []\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 2adeaa3427b..4cb7b093b30 100644
--- a/src/mongo/db/query/optimizer/physical_rewriter_optimizer_test.cpp
+++ b/src/mongo/db/query/optimizer/physical_rewriter_optimizer_test.cpp
@@ -735,10 +735,7 @@ TEST(PhysRewriter, FilterIndexing) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -898,10 +895,7 @@ TEST(PhysRewriter, FilterIndexing2) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -973,10 +967,7 @@ TEST(PhysRewriter, FilterIndexing2NonSarg) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -1138,10 +1129,7 @@ TEST(PhysRewriter, FilterIndexing3MultiKey) {
"| Variable [pa]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'a': pa}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -1564,10 +1552,7 @@ TEST(PhysRewriter, FilterIndexingVariable) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -1714,10 +1699,7 @@ TEST(PhysRewriter, FilterIndexingRIN) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -1734,20 +1716,14 @@ TEST(PhysRewriter, FilterIndexingRIN) {
"| Union [{evalTemp_59, evalTemp_60}]\n"
"| | NestedLoopJoin [joinType: Inner, {rinInner_2, rinInner_3}]\n"
"| | | | Const [true]\n"
- "| | | LimitSkip []\n"
- "| | | | limitSkip:\n"
- "| | | | limit: 1\n"
- "| | | | skip: 0\n"
+ "| | | LimitSkip [limit: 1, skip: 0]\n"
"| | | IndexScan [{'<indexKey> 2': evalTemp_59, '<indexKey> 3': evalTemp_60}, "
"scanDefName: c1, indexDefName: index1, interval: {(Variable [evalTemp_57] | Variable "
"[evalTemp_58] | Variable [rinInner_2] | Variable [rinInner_3] | Const [maxKey], Variable "
"[evalTemp_57] | Variable [evalTemp_58] | Const [maxKey] | Const [maxKey] | Const "
"[maxKey])}]\n"
"| | SpoolConsumer [Stack, id: 1, {rinInner_2, rinInner_3}]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| IndexScan [{'<indexKey> 2': evalTemp_59, '<indexKey> 3': evalTemp_60}, scanDefName: "
"c1, indexDefName: index1, interval: {(Variable [evalTemp_57] | Variable [evalTemp_58] | "
"Const [2] | Const [maxKey] | Const [maxKey], Variable [evalTemp_57] | Variable "
@@ -1757,19 +1733,13 @@ TEST(PhysRewriter, FilterIndexingRIN) {
"Union [{evalTemp_57, evalTemp_58}]\n"
"| NestedLoopJoin [joinType: Inner, {rinInner_0, rinInner_1}]\n"
"| | | Const [true]\n"
- "| | LimitSkip []\n"
- "| | | limitSkip:\n"
- "| | | limit: 1\n"
- "| | | skip: 0\n"
+ "| | LimitSkip [limit: 1, skip: 0]\n"
"| | IndexScan [{'<indexKey> 0': evalTemp_57, '<indexKey> 1': evalTemp_58}, "
"scanDefName: c1, indexDefName: index1, interval: {(Variable [rinInner_0] | Variable "
"[rinInner_1] | Const [maxKey] | Const [maxKey] | Const [maxKey], Const [maxKey | maxKey | "
"maxKey | maxKey | maxKey])}]\n"
"| SpoolConsumer [Stack, id: 2, {rinInner_0, rinInner_1}]\n"
- "LimitSkip []\n"
- "| limitSkip:\n"
- "| limit: 1\n"
- "| skip: 0\n"
+ "LimitSkip [limit: 1, skip: 0]\n"
"IndexScan [{'<indexKey> 0': evalTemp_57, '<indexKey> 1': evalTemp_58}, scanDefName: c1, "
"indexDefName: index1, interval: {>Const [1 | maxKey | maxKey | maxKey | maxKey]}]\n",
optimized);
@@ -1832,10 +1802,7 @@ TEST(PhysRewriter, FilterIndexingRIN1) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -1848,17 +1815,11 @@ TEST(PhysRewriter, FilterIndexingRIN1) {
"Union [{pa}]\n"
"| NestedLoopJoin [joinType: Inner, {rinInner_1}]\n"
"| | | Const [true]\n"
- "| | LimitSkip []\n"
- "| | | limitSkip:\n"
- "| | | limit: 1\n"
- "| | | skip: 0\n"
+ "| | LimitSkip [limit: 1, skip: 0]\n"
"| | IndexScan [{'<indexKey> 0': pa}, scanDefName: c1, indexDefName: index1, interval: "
"{(Const [1 | maxKey], Variable [rinInner_1] | Const [minKey])}, reversed]\n"
"| SpoolConsumer [Stack, id: 2, {rinInner_1}]\n"
- "LimitSkip []\n"
- "| limitSkip:\n"
- "| limit: 1\n"
- "| skip: 0\n"
+ "LimitSkip [limit: 1, skip: 0]\n"
"IndexScan [{'<indexKey> 0': pa}, scanDefName: c1, indexDefName: index1, interval: {>Const "
"[1 | maxKey]}, reversed]\n",
optimized);
@@ -1922,10 +1883,7 @@ TEST(PhysRewriter, FilterIndexingRIN2) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -1963,17 +1921,11 @@ TEST(PhysRewriter, FilterIndexingRIN2) {
"| Union [{disjunction_0}]\n"
"| | NestedLoopJoin [joinType: Inner, {rinInner_1}]\n"
"| | | | Const [true]\n"
- "| | | LimitSkip []\n"
- "| | | | limitSkip:\n"
- "| | | | limit: 1\n"
- "| | | | skip: 0\n"
+ "| | | LimitSkip [limit: 1, skip: 0]\n"
"| | | IndexScan [{'<indexKey> 0': disjunction_0}, scanDefName: c1, indexDefName: "
"index1, interval: {(Variable [rinInner_1] | Const [maxKey], Const [4 | maxKey])}]\n"
"| | SpoolConsumer [Stack, id: 2, {rinInner_1}]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| IndexScan [{'<indexKey> 0': disjunction_0}, scanDefName: c1, indexDefName: index1, "
"interval: {[Const [3 | minKey], Const [4 | maxKey]]}]\n"
"NestedLoopJoin [joinType: Inner, {disjunction_0}]\n"
@@ -1998,17 +1950,11 @@ TEST(PhysRewriter, FilterIndexingRIN2) {
"Union [{disjunction_0}]\n"
"| NestedLoopJoin [joinType: Inner, {rinInner_0}]\n"
"| | | Const [true]\n"
- "| | LimitSkip []\n"
- "| | | limitSkip:\n"
- "| | | limit: 1\n"
- "| | | skip: 0\n"
+ "| | LimitSkip [limit: 1, skip: 0]\n"
"| | IndexScan [{'<indexKey> 0': disjunction_0}, scanDefName: c1, indexDefName: "
"index1, interval: {(Variable [rinInner_0] | Const [maxKey], Const [2 | maxKey])}]\n"
"| SpoolConsumer [Stack, id: 1, {rinInner_0}]\n"
- "LimitSkip []\n"
- "| limitSkip:\n"
- "| limit: 1\n"
- "| skip: 0\n"
+ "LimitSkip [limit: 1, skip: 0]\n"
"IndexScan [{'<indexKey> 0': disjunction_0}, scanDefName: c1, indexDefName: index1, "
"interval: {[Const [1 | minKey], Const [2 | maxKey]]}]\n",
optimized);
@@ -2258,10 +2204,7 @@ TEST(PhysRewriter, CoveredScan) {
"| Variable [pa]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'a': pa}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -2408,10 +2351,7 @@ TEST(PhysRewriter, EvalIndexing1) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -2573,10 +2513,7 @@ TEST(PhysRewriter, MultiKeyIndex) {
"| Variable [pb]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -2637,10 +2574,7 @@ TEST(PhysRewriter, MultiKeyIndex) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -3071,10 +3005,7 @@ TEST(PhysRewriter, CompoundIndex5) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -3230,10 +3161,7 @@ TEST(PhysRewriter, IndexBoundsIntersect1) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -3297,10 +3225,7 @@ TEST(PhysRewriter, IndexBoundsIntersect2) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -3572,10 +3497,7 @@ TEST(PhysRewriter, IndexResidualReq1) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -3637,10 +3559,7 @@ TEST(PhysRewriter, IndexResidualReq2) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -3706,10 +3625,7 @@ TEST(PhysRewriter, ElemMatchIndex) {
"| | EvalFilter []\n"
"| | | Variable [evalTemp_4]\n"
"| | PathArr []\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root, 'a': evalTemp_4}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -3784,10 +3700,7 @@ TEST(PhysRewriter, ElemMatchIndex1) {
"| | EvalFilter []\n"
"| | | Variable [evalTemp_17]\n"
"| | PathArr []\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root, 'a': evalTemp_17}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -3848,10 +3761,7 @@ TEST(PhysRewriter, ElemMatchIndexNoArrays) {
"| Variable [root]\n"
"Evaluation [{root}]\n"
"| Const [Nothing]\n"
- "LimitSkip []\n"
- "| limitSkip:\n"
- "| limit: 0\n"
- "| skip: 0\n"
+ "LimitSkip [limit: 0, skip: 0]\n"
"CoScan []\n",
optimized);
}
@@ -3937,10 +3847,7 @@ TEST(PhysRewriter, ObjectElemMatchResidual) {
"| | EvalFilter []\n"
"| | | Variable [evalTemp_3]\n"
"| | PathArr []\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root, 'a': evalTemp_3}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -4028,10 +3935,7 @@ TEST(PhysRewriter, ObjectElemMatchBounds) {
"| | EvalFilter []\n"
"| | | Variable [evalTemp_2]\n"
"| | PathArr []\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root, 'a': evalTemp_2}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -4105,10 +4009,7 @@ TEST(PhysRewriter, NestedElemMatch) {
"| | EvalFilter []\n"
"| | | Variable [evalTemp_2]\n"
"| | PathArr []\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root, 'a': evalTemp_2}, coll1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -4185,10 +4086,7 @@ TEST(PhysRewriter, PathObj) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -4274,10 +4172,7 @@ TEST(PhysRewriter, ArrayConstantIndex) {
"| Const [[1, 2, 3]]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -4581,10 +4476,7 @@ TEST(PhysRewriter, IndexPartitioning0) {
"| | | Variable [pb]\n"
"| | PathCompare [Gt]\n"
"| | Const [1]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'b': pb}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -4906,10 +4798,7 @@ TEST(PhysRewriter, LocalLimitSkip) {
"| type: Centralized\n"
"| indexingRequirement: \n"
"| Complete, dedupRID\n"
- "LimitSkip []\n"
- "| limitSkip:\n"
- "| limit: 20\n"
- "| skip: 10\n"
+ "LimitSkip [limit: 20, skip: 10]\n"
"Properties [cost: 0.00676997, localCost: 0.003001, adjustedCE: 30]\n"
"| | Logical:\n"
"| | cardinalityEstimate: \n"
@@ -5147,10 +5036,7 @@ TEST(PhysRewriter, PartialIndex1) {
"| | PathTraverse [1]\n"
"| | PathCompare [Eq]\n"
"| | Const [2]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root, 'b': evalTemp_4}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -5215,10 +5101,7 @@ TEST(PhysRewriter, PartialIndex2) {
"| Variable [root]\n"
"NestedLoopJoin [joinType: Inner, {rid_0}]\n"
"| | Const [true]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -5946,10 +5829,7 @@ TEST(PhysRewriter, EqMemberSargable) {
"| | indexingRequirement: \n"
"| | Seek, dedupRID\n"
"| | repetitionEstimate: 54.6819\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -6154,10 +6034,7 @@ TEST(PhysRewriter, PerfOnlyPreds1) {
"| | EvalFilter []\n"
"| | | Variable [pa]\n"
"| | PathCompare [Lt] Const [1]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'a': pa, 'b': evalTemp_3}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -6242,10 +6119,7 @@ TEST(PhysRewriter, PerfOnlyPreds2) {
"| | EvalFilter []\n"
"| | | Variable [pa]\n"
"| | PathCompare [Eq] Const [1]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'a': pa, 'b': evalTemp_2}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -6327,10 +6201,7 @@ TEST(PhysRewriter, ConjunctionTraverseMultikey1) {
"| | PathGet [x]\n"
"| | PathCompare [Eq]\n"
"| | Const [1]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root, 'a': evalTemp_11}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
@@ -6400,10 +6271,7 @@ TEST(PhysRewriter, ConjunctionTraverseMultikey2) {
"| | PathGet [x]\n"
"| | PathCompare [Eq]\n"
"| | Const [1]\n"
- "| LimitSkip []\n"
- "| | limitSkip:\n"
- "| | limit: 1\n"
- "| | skip: 0\n"
+ "| LimitSkip [limit: 1, skip: 0]\n"
"| Seek [ridProjection: rid_0, {'<root>': root, 'a': evalTemp_5}, c1]\n"
"| RefBlock: \n"
"| Variable [rid_0]\n"
diff --git a/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_limit_skip_node.txt b/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_limit_skip_node.txt
index dfa49bd0541..3726b09e5c0 100644
--- a/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_limit_skip_node.txt
+++ b/src/mongo/db/test_output/exec/sbe/a_b_t_plan_generation/lower_limit_skip_node.txt
@@ -2,10 +2,7 @@
==== VARIATION: Lower single limit without skip ====
-- INPUT:
-LimitSkip []
-| limitSkip:
-| limit: 5
-| skip: 0
+LimitSkip [limit: 5, skip: 0]
PhysicalScan [{'<root>': scan0}, collName]
-- OUTPUT:
@@ -14,10 +11,7 @@ PhysicalScan [{'<root>': scan0}, collName]
==== VARIATION: Lower single skip without limit ====
-- INPUT:
-LimitSkip []
-| limitSkip:
-| limit: 0
-| skip: 4
+LimitSkip [limit: 0, skip: 4]
PhysicalScan [{'<root>': scan0}, collName]
-- OUTPUT:
@@ -26,10 +20,7 @@ PhysicalScan [{'<root>': scan0}, collName]
==== VARIATION: Lower LimitSkip node with values for both limit and skip ====
-- INPUT:
-LimitSkip []
-| limitSkip:
-| limit: 4
-| skip: 2
+LimitSkip [limit: 4, skip: 2]
PhysicalScan [{'<root>': scan0}, collName]
-- OUTPUT:
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 3b54be5eaff..2eeb6d52490 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
@@ -4,10 +4,7 @@
-- INPUT:
NestedLoopJoin [joinType: Inner, {rid}]
| | Const [true]
-| LimitSkip []
-| | limitSkip:
-| | limit: 1
-| | skip: 0
+| LimitSkip [limit: 1, skip: 0]
| Seek [ridProjection: rid, {'<root>': scan0}, collName]
| RefBlock:
| Variable [rid]
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 9c7307461f1..97dd322d6b2 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
@@ -401,10 +401,7 @@ Root []
| Variable [scan_0]
NestedLoopJoin [joinType: Inner, {rid_0}]
| | Const [true]
-| LimitSkip []
-| | limitSkip:
-| | limit: 1
-| | skip: 0
+| LimitSkip [limit: 1, skip: 0]
| Seek [ridProjection: rid_0, {'<root>': scan_0}, collection]
| RefBlock:
| Variable [rid_0]
@@ -755,10 +752,7 @@ Collation []
| Variable [sort_0]
NestedLoopJoin [joinType: Inner, {rid_0}]
| | Const [true]
-| LimitSkip []
-| | limitSkip:
-| | limit: 1
-| | skip: 0
+| LimitSkip [limit: 1, skip: 0]
| Seek [ridProjection: rid_0, {'<root>': scan_0, 'a': sort_0}, collection]
| RefBlock:
| Variable [rid_0]
@@ -808,10 +802,7 @@ Root []
| Variable [scan_0]
NestedLoopJoin [joinType: Inner, {rid_0}]
| | Const [true]
-| LimitSkip []
-| | limitSkip:
-| | limit: 1
-| | skip: 0
+| LimitSkip [limit: 1, skip: 0]
| Seek [ridProjection: rid_0, {'<root>': scan_0}, collection]
| RefBlock:
| Variable [rid_0]
@@ -887,10 +878,7 @@ Root []
| Variable [scan_0]
NestedLoopJoin [joinType: Inner, {rid_0}]
| | Const [true]
-| LimitSkip []
-| | limitSkip:
-| | limit: 1
-| | skip: 0
+| LimitSkip [limit: 1, skip: 0]
| Seek [ridProjection: rid_0, {'<root>': scan_0}, collection]
| RefBlock:
| Variable [rid_0]
@@ -947,10 +935,7 @@ NestedLoopJoin [joinType: Inner, {rid_0}]
| | PathTraverse [1]
| | PathCompare [Eq]
| | Const [2]
-| LimitSkip []
-| | limitSkip:
-| | limit: 1
-| | skip: 0
+| LimitSkip [limit: 1, skip: 0]
| Seek [ridProjection: rid_0, {'<root>': scan_0, 'b': evalTemp_4}, collection]
| RefBlock:
| Variable [rid_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 b17bc4c3353..83219578262 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
@@ -56,10 +56,7 @@ NestedLoopJoin [joinType: Inner, {rid_0}]
| | | | Const [2]
| | | Variable [valCmp_0]
| | Variable [evalTemp_4]
-| LimitSkip []
-| | limitSkip:
-| | limit: 1
-| | skip: 0
+| LimitSkip [limit: 1, skip: 0]
| Seek [ridProjection: rid_0, {'<root>': scan_0, 'b': evalTemp_4}, collection]
| RefBlock:
| Variable [rid_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 d73e3db1df7..55be55d1bf1 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
@@ -36,14 +36,8 @@ Evaluation [{sort_0}]
| | Variable [scan_0]
| PathGet [a]
| PathIdentity []
-LimitSkip []
-| limitSkip:
-| limit: (none)
-| skip: 3
-LimitSkip []
-| limitSkip:
-| limit: 5
-| skip: 0
+LimitSkip [limit: (none), skip: 3]
+LimitSkip [limit: 5, skip: 0]
Scan [collection, {scan_0}]