summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJennifer Peshansky <jennifer.peshansky@mongodb.com>2022-09-21 15:35:34 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-09-21 16:54:55 +0000
commit6f450a3cea6287612329f44e90536d72fe7c16c5 (patch)
tree46d2685c8334602687e2ff414df20d77f4c0ea27
parent1d61d0b76ec6b6c130d6d2433d56df5524a7a82c (diff)
downloadmongo-6f450a3cea6287612329f44e90536d72fe7c16c5.tar.gz
SERVER-69748 Remove redundant totalPipelineLookup counter
-rw-r--r--jstests/noPassthrough/lookup_metrics.js12
-rw-r--r--src/mongo/db/curop.h3
-rw-r--r--src/mongo/db/pipeline/pipeline_d.cpp1
-rw-r--r--src/mongo/db/stats/counters.h14
4 files changed, 9 insertions, 21 deletions
diff --git a/jstests/noPassthrough/lookup_metrics.js b/jstests/noPassthrough/lookup_metrics.js
index f8e76e7408d..810fb81f812 100644
--- a/jstests/noPassthrough/lookup_metrics.js
+++ b/jstests/noPassthrough/lookup_metrics.js
@@ -56,19 +56,17 @@ function generateExpectedCounters(joinStrategy = lookupStrategy.nonSbe, spillToD
let counters = db.serverStatus().metrics.query.lookup;
assert(counters, "counters did not exist");
let expected = Object.assign(counters);
- expected.pipelineTotalCount = NumberLong(expected.pipelineTotalCount + 1);
- let sbeCounters = expected.slotBasedExecutionCounters;
switch (joinStrategy) {
case lookupStrategy.nestedLoopJoin:
- sbeCounters.nestedLoopJoin = NumberLong(sbeCounters.nestedLoopJoin + 1);
+ expected.nestedLoopJoin = NumberLong(expected.nestedLoopJoin + 1);
break;
case lookupStrategy.indexedLoopJoin:
- sbeCounters.indexedLoopJoin = NumberLong(sbeCounters.indexedLoopJoin + 1);
+ expected.indexedLoopJoin = NumberLong(expected.indexedLoopJoin + 1);
break;
case lookupStrategy.hashLookup:
- sbeCounters.hashLookup = NumberLong(sbeCounters.hashLookup + 1);
- sbeCounters.hashLookupSpillToDisk =
- NumberLong(sbeCounters.hashLookupSpillToDisk + spillToDisk);
+ expected.hashLookup = NumberLong(expected.hashLookup + 1);
+ expected.hashLookupSpillToDisk =
+ NumberLong(expected.hashLookupSpillToDisk + spillToDisk);
break;
}
return expected;
diff --git a/src/mongo/db/curop.h b/src/mongo/db/curop.h
index 6418883a605..d0e5d13313d 100644
--- a/src/mongo/db/curop.h
+++ b/src/mongo/db/curop.h
@@ -277,9 +277,6 @@ public:
// Indicates whether this operation used the common query framework (CQF).
bool cqfUsed{false};
- // Tracks whether an aggregation query has a lookup stage regardless of the engine used.
- bool pipelineUsesLookup{false};
-
// Tracks the amount of indexed loop joins in a pushed down lookup stage.
int indexedLoopJoin{0};
diff --git a/src/mongo/db/pipeline/pipeline_d.cpp b/src/mongo/db/pipeline/pipeline_d.cpp
index f05ffb88d16..42244a92098 100644
--- a/src/mongo/db/pipeline/pipeline_d.cpp
+++ b/src/mongo/db/pipeline/pipeline_d.cpp
@@ -185,7 +185,6 @@ std::vector<std::unique_ptr<InnerPipelineStageInterface>> extractSbeCompatibleSt
// $lookup pushdown logic.
if (auto lookupStage = dynamic_cast<DocumentSourceLookUp*>(itr->get())) {
- CurOp::get(expCtx->opCtx)->debug().pipelineUsesLookup = true;
if (disallowLookupPushdown) {
break;
}
diff --git a/src/mongo/db/stats/counters.h b/src/mongo/db/stats/counters.h
index b1661392574..dcd9d432be5 100644
--- a/src/mongo/db/stats/counters.h
+++ b/src/mongo/db/stats/counters.h
@@ -367,24 +367,18 @@ public:
LookupPushdownCounters() = default;
void incrementLookupCounters(OpDebug& debug) {
- if (debug.pipelineUsesLookup) {
- totalLookup.increment();
- }
nestedLoopJoin.increment(debug.nestedLoopJoin);
indexedLoopJoin.increment(debug.indexedLoopJoin);
hashLookup.increment(debug.hashLookup);
hashLookupSpillToDisk.increment(debug.hashLookupSpillToDisk);
}
- // Counter tracking pipelines that have a lookup stage regardless of the engine used.
- CounterMetric totalLookup{"query.lookup.pipelineTotalCount"};
// Counters for lookup join strategies.
- CounterMetric nestedLoopJoin{"query.lookup.slotBasedExecutionCounters.nestedLoopJoin"};
- CounterMetric indexedLoopJoin{"query.lookup.slotBasedExecutionCounters.indexedLoopJoin"};
- CounterMetric hashLookup{"query.lookup.slotBasedExecutionCounters.hashLookup"};
+ CounterMetric nestedLoopJoin{"query.lookup.nestedLoopJoin"};
+ CounterMetric indexedLoopJoin{"query.lookup.indexedLoopJoin"};
+ CounterMetric hashLookup{"query.lookup.hashLookup"};
// Counter tracking hashLookup spills in lookup stages that get pushed down.
- CounterMetric hashLookupSpillToDisk{
- "query.lookup.slotBasedExecutionCounters.hashLookupSpillToDisk"};
+ CounterMetric hashLookupSpillToDisk{"query.lookup.hashLookupSpillToDisk"};
};
extern LookupPushdownCounters lookupPushdownCounters;