summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/explain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/explain.cpp')
-rw-r--r--src/mongo/db/query/explain.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/query/explain.cpp b/src/mongo/db/query/explain.cpp
index 709d8ffda4a..eb109928be4 100644
--- a/src/mongo/db/query/explain.cpp
+++ b/src/mongo/db/query/explain.cpp
@@ -34,6 +34,7 @@
#include "mongo/base/owned_pointer_vector.h"
#include "mongo/bson/util/builder.h"
#include "mongo/db/exec/cached_plan.h"
+#include "mongo/db/exec/collection_scan.h"
#include "mongo/db/exec/count_scan.h"
#include "mongo/db/exec/distinct_scan.h"
#include "mongo/db/exec/idhack.h"
@@ -1015,6 +1016,13 @@ void Explain::getSummaryStats(const PlanExecutor& exec, PlanSummaryStats* statsO
statsOut->replanned = cachedStats->replanned;
} else if (STAGE_MULTI_PLAN == stages[i]->stageType()) {
statsOut->fromMultiPlanner = true;
+ } else if (STAGE_COLLSCAN == stages[i]->stageType()) {
+ statsOut->collectionScans++;
+ const auto collScan = static_cast<const CollectionScan*>(stages[i]);
+ const auto collScanStats =
+ static_cast<const CollectionScanStats*>(collScan->getSpecificStats());
+ if (!collScanStats->tailable)
+ statsOut->collectionScansNonTailable++;
}
}
}