diff options
author | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2019-07-10 18:38:03 -0400 |
---|---|---|
committer | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2019-07-10 18:38:03 -0400 |
commit | cb3b6c8b2a28190560906db4d78ef833eec44425 (patch) | |
tree | 8f550393c99b15f4b27d9bbb27115fc451930be7 /src | |
parent | a4ef14ef41f0700ef07e5b57b0345d2396a44604 (diff) | |
download | mongo-cb3b6c8b2a28190560906db4d78ef833eec44425.tar.gz |
Revert "SERVER-40755 Expose statistics which indicate how many collection scans have executed"
This reverts commit a4ef14ef41f0700ef07e5b57b0345d2396a44604.
Diffstat (limited to 'src')
24 files changed, 19 insertions, 176 deletions
diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript index 61ee62fece7..39cce30206b 100644 --- a/src/mongo/db/SConscript +++ b/src/mongo/db/SConscript @@ -455,7 +455,6 @@ env.Library( ], LIBDEPS=[ '$BUILD_DIR/mongo/base', - '$BUILD_DIR/mongo/db/commands/server_status_core', ], ) diff --git a/src/mongo/db/catalog/collection_info_cache.h b/src/mongo/db/catalog/collection_info_cache.h index 8ae84fb3eec..254df201721 100644 --- a/src/mongo/db/catalog/collection_info_cache.h +++ b/src/mongo/db/catalog/collection_info_cache.h @@ -31,7 +31,6 @@ #include "mongo/db/collection_index_usage_tracker.h" #include "mongo/db/query/plan_cache.h" -#include "mongo/db/query/plan_summary_stats.h" #include "mongo/db/query/query_settings.h" #include "mongo/db/update_index_data.h" @@ -78,12 +77,6 @@ public: virtual CollectionIndexUsageMap getIndexUsageStats() const = 0; /** - * Returns a struct containing information on the number of collection scans that have been - * performed. - */ - virtual CollectionIndexUsageTracker::CollectionScanStats getCollectionScanStats() const = 0; - - /** * Register a newly-created index with the cache. Must be called whenever an index is * built on the associated collection. * @@ -106,12 +99,10 @@ public: /** * Signal to the cache that a query operation has completed. 'indexesUsed' should list the - * set of indexes used by the winning plan, if any. 'summaryStats.collectionScans' and - * 'summaryStats.collectionScansNonTailable' should be the number of collections scans and - * non-tailable collection scans that occured while executing the winning plan. + * set of indexes used by the winning plan, if any. */ virtual void notifyOfQuery(OperationContext* const opCtx, - const PlanSummaryStats& summaryStats) = 0; + const std::set<std::string>& indexesUsed) = 0; virtual void setNs(NamespaceString ns) = 0; }; diff --git a/src/mongo/db/catalog/collection_info_cache_impl.cpp b/src/mongo/db/catalog/collection_info_cache_impl.cpp index b79def3cd04..bf4866b750a 100644 --- a/src/mongo/db/catalog/collection_info_cache_impl.cpp +++ b/src/mongo/db/catalog/collection_info_cache_impl.cpp @@ -38,7 +38,6 @@ #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/index_catalog.h" #include "mongo/db/concurrency/d_concurrency.h" -#include "mongo/db/curop_metrics.h" #include "mongo/db/fts/fts_spec.h" #include "mongo/db/index/index_descriptor.h" #include "mongo/db/index/wildcard_access_method.h" @@ -163,11 +162,7 @@ void CollectionInfoCacheImpl::computeIndexKeys(OperationContext* opCtx) { } void CollectionInfoCacheImpl::notifyOfQuery(OperationContext* opCtx, - const PlanSummaryStats& summaryStats) { - _indexUsageTracker.recordCollectionScans(summaryStats.collectionScans); - _indexUsageTracker.recordCollectionScansNonTailable(summaryStats.collectionScansNonTailable); - - const auto& indexesUsed = summaryStats.indexesUsed; + const std::set<std::string>& indexesUsed) { // Record indexes used to fulfill query. for (auto it = indexesUsed.begin(); it != indexesUsed.end(); ++it) { // This index should still exist, since the PlanExecutor would have been killed if the @@ -268,9 +263,4 @@ void CollectionInfoCacheImpl::setNs(NamespaceString ns) { } } -CollectionIndexUsageTracker::CollectionScanStats CollectionInfoCacheImpl::getCollectionScanStats() - const { - return _indexUsageTracker.getCollectionScanStats(); -} - } // namespace mongo diff --git a/src/mongo/db/catalog/collection_info_cache_impl.h b/src/mongo/db/catalog/collection_info_cache_impl.h index cf66d8e2e99..ff6566f36e5 100644 --- a/src/mongo/db/catalog/collection_info_cache_impl.h +++ b/src/mongo/db/catalog/collection_info_cache_impl.h @@ -76,8 +76,6 @@ public: */ CollectionIndexUsageMap getIndexUsageStats() const; - CollectionIndexUsageTracker::CollectionScanStats getCollectionScanStats() const override; - /** * Builds internal cache state based on the current state of the Collection's IndexCatalog */ @@ -104,7 +102,11 @@ public: */ void clearQueryCache(); - void notifyOfQuery(OperationContext* opCtx, const PlanSummaryStats& summaryStats); + /** + * Signal to the cache that a query operation has completed. 'indexesUsed' should list the + * set of indexes used by the winning plan, if any. + */ + void notifyOfQuery(OperationContext* opCtx, const std::set<std::string>& indexesUsed); void setNs(NamespaceString ns) override; diff --git a/src/mongo/db/collection_index_usage_tracker.cpp b/src/mongo/db/collection_index_usage_tracker.cpp index 3f78b3c406a..dc0941ff4c8 100644 --- a/src/mongo/db/collection_index_usage_tracker.cpp +++ b/src/mongo/db/collection_index_usage_tracker.cpp @@ -31,23 +31,12 @@ #include "mongo/platform/basic.h" -#include "mongo/base/counter.h" #include "mongo/db/collection_index_usage_tracker.h" -#include "mongo/db/commands/server_status_metric.h" #include "mongo/util/assert_util.h" #include "mongo/util/clock_source.h" #include "mongo/util/log.h" namespace mongo { -namespace { -Counter64 collectionScansCounter; -Counter64 collectionScansNonTailableCounter; - -ServerStatusMetricField<Counter64> displayCollectionScans("queryExecutor.collectionScans.total", - &collectionScansCounter); -ServerStatusMetricField<Counter64> displayCollectionScansNonTailable( - "queryExecutor.collectionScans.nonTailable", &collectionScansNonTailableCounter); -} CollectionIndexUsageTracker::CollectionIndexUsageTracker(ClockSource* clockSource) : _clockSource(clockSource) { @@ -61,17 +50,6 @@ void CollectionIndexUsageTracker::recordIndexAccess(StringData indexName) { _indexUsageMap[indexName].accesses.fetchAndAdd(1); } -void CollectionIndexUsageTracker::recordCollectionScans(unsigned long long collectionScans) { - _collectionScans.fetchAndAdd(collectionScans); - collectionScansCounter.increment(collectionScans); -} - -void CollectionIndexUsageTracker::recordCollectionScansNonTailable( - unsigned long long collectionScansNonTailable) { - _collectionScansNonTailable.fetchAndAdd(collectionScansNonTailable); - collectionScansNonTailableCounter.increment(collectionScansNonTailable); -} - void CollectionIndexUsageTracker::registerIndex(StringData indexName, const BSONObj& indexKey) { invariant(!indexName.empty()); dassert(_indexUsageMap.find(indexName) == _indexUsageMap.end()); @@ -90,8 +68,4 @@ CollectionIndexUsageMap CollectionIndexUsageTracker::getUsageStats() const { return _indexUsageMap; } -CollectionIndexUsageTracker::CollectionScanStats -CollectionIndexUsageTracker::getCollectionScanStats() const { - return {_collectionScans.load(), _collectionScansNonTailable.load()}; -} } // namespace mongo diff --git a/src/mongo/db/collection_index_usage_tracker.h b/src/mongo/db/collection_index_usage_tracker.h index b70d7887723..62c3b610f41 100644 --- a/src/mongo/db/collection_index_usage_tracker.h +++ b/src/mongo/db/collection_index_usage_tracker.h @@ -44,9 +44,6 @@ class ClockSource; * considered "used" when it appears as part of a winning plan for an operation that uses the * query system. * - * It also tracks non-usage of indexes. I.e. it collects information about collection scans that - * occur on a collection. - * * Indexes must be registered and deregistered on creation/destruction. */ class CollectionIndexUsageTracker { @@ -54,11 +51,6 @@ class CollectionIndexUsageTracker { CollectionIndexUsageTracker& operator=(const CollectionIndexUsageTracker&) = delete; public: - struct CollectionScanStats { - unsigned long long collectionScans{0}; - unsigned long long collectionScansNonTailable{0}; - }; - struct IndexUsageStats { IndexUsageStats() = default; explicit IndexUsageStats(Date_t now, const BSONObj& key) @@ -119,15 +111,6 @@ public: */ StringMap<CollectionIndexUsageTracker::IndexUsageStats> getUsageStats() const; - /** - * Get the current state of the usage of collection scans. This struct will only include - * information about the collection scans that have occured at the time of calling. - */ - CollectionScanStats getCollectionScanStats() const; - - void recordCollectionScans(unsigned long long collectionScans); - void recordCollectionScansNonTailable(unsigned long long collectionScansNonTailable); - private: // Map from index name to usage statistics. StringMap<CollectionIndexUsageTracker::IndexUsageStats> _indexUsageMap; @@ -135,10 +118,8 @@ private: // Clock source. Used when the 'trackerStartTime' time for an IndexUsageStats object needs to // be set. ClockSource* _clockSource; - - AtomicWord<unsigned long long> _collectionScans{0}; - AtomicWord<unsigned long long> _collectionScansNonTailable{0}; }; typedef StringMap<CollectionIndexUsageTracker::IndexUsageStats> CollectionIndexUsageMap; + } // namespace mongo diff --git a/src/mongo/db/commands/count_cmd.cpp b/src/mongo/db/commands/count_cmd.cpp index 545afc0c174..82a6408b6e8 100644 --- a/src/mongo/db/commands/count_cmd.cpp +++ b/src/mongo/db/commands/count_cmd.cpp @@ -243,7 +243,7 @@ public: PlanSummaryStats summaryStats; Explain::getSummaryStats(*exec, &summaryStats); if (collection) { - collection->infoCache()->notifyOfQuery(opCtx, summaryStats); + collection->infoCache()->notifyOfQuery(opCtx, summaryStats.indexesUsed); } curOp->debug().setPlanSummaryMetrics(summaryStats); diff --git a/src/mongo/db/commands/distinct.cpp b/src/mongo/db/commands/distinct.cpp index ac156b32c30..eee399d134d 100644 --- a/src/mongo/db/commands/distinct.cpp +++ b/src/mongo/db/commands/distinct.cpp @@ -285,7 +285,7 @@ public: PlanSummaryStats stats; Explain::getSummaryStats(*executor.getValue(), &stats); if (collection) { - collection->infoCache()->notifyOfQuery(opCtx, stats); + collection->infoCache()->notifyOfQuery(opCtx, stats.indexesUsed); } curOp->debug().setPlanSummaryMetrics(stats); diff --git a/src/mongo/db/commands/find_and_modify.cpp b/src/mongo/db/commands/find_and_modify.cpp index ee2a87987d2..a60dfa214e0 100644 --- a/src/mongo/db/commands/find_and_modify.cpp +++ b/src/mongo/db/commands/find_and_modify.cpp @@ -396,7 +396,7 @@ public: PlanSummaryStats summaryStats; Explain::getSummaryStats(*exec, &summaryStats); if (collection) { - collection->infoCache()->notifyOfQuery(opCtx, summaryStats); + collection->infoCache()->notifyOfQuery(opCtx, summaryStats.indexesUsed); } opDebug->setPlanSummaryMetrics(summaryStats); @@ -494,7 +494,7 @@ public: PlanSummaryStats summaryStats; Explain::getSummaryStats(*exec, &summaryStats); if (collection) { - collection->infoCache()->notifyOfQuery(opCtx, summaryStats); + collection->infoCache()->notifyOfQuery(opCtx, summaryStats.indexesUsed); } UpdateStage::recordUpdateStatsInOpDebug(UpdateStage::getUpdateStats(exec.get()), opDebug); diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp index 74ec1dbfdbe..45f0fd6fbed 100644 --- a/src/mongo/db/commands/mr.cpp +++ b/src/mongo/db/commands/mr.cpp @@ -1563,7 +1563,7 @@ bool runMapReduce(OperationContext* opCtx, // TODO SERVER-23261: Confirm whether this is the correct place to gather all // metrics. There is no harm adding here for the time being. curOp->debug().setPlanSummaryMetrics(stats); - scopedAutoColl->getCollection()->infoCache()->notifyOfQuery(opCtx, stats); + scopedAutoColl->getCollection()->infoCache()->notifyOfQuery(opCtx, stats.indexesUsed); if (curOp->shouldDBProfile()) { BSONObjBuilder execStatsBob; diff --git a/src/mongo/db/commands/run_aggregate.cpp b/src/mongo/db/commands/run_aggregate.cpp index ab63dec4dbe..1a62a4b0b34 100644 --- a/src/mongo/db/commands/run_aggregate.cpp +++ b/src/mongo/db/commands/run_aggregate.cpp @@ -786,7 +786,7 @@ Status runAggregate(OperationContext* opCtx, // For an optimized away pipeline, signal the cache that a query operation has completed. // For normal pipelines this is done in DocumentSourceCursor. if (ctx && ctx->getCollection()) { - ctx->getCollection()->infoCache()->notifyOfQuery(opCtx, stats); + ctx->getCollection()->infoCache()->notifyOfQuery(opCtx, stats.indexesUsed); } } diff --git a/src/mongo/db/exec/collection_scan.cpp b/src/mongo/db/exec/collection_scan.cpp index e06493b39eb..6a1e64dd30f 100644 --- a/src/mongo/db/exec/collection_scan.cpp +++ b/src/mongo/db/exec/collection_scan.cpp @@ -67,7 +67,6 @@ CollectionScan::CollectionScan(OperationContext* opCtx, // Explain reports the direction of the collection scan. _specificStats.direction = params.direction; _specificStats.maxTs = params.maxTs; - _specificStats.tailable = params.tailable; invariant(!_params.shouldTrackLatestOplogTimestamp || collection->ns().isOplog()); if (params.maxTs) { diff --git a/src/mongo/db/exec/plan_stats.h b/src/mongo/db/exec/plan_stats.h index 08d623ffc44..e85a508979f 100644 --- a/src/mongo/db/exec/plan_stats.h +++ b/src/mongo/db/exec/plan_stats.h @@ -198,8 +198,6 @@ struct CollectionScanStats : public SpecificStats { // backwards. int direction; - bool tailable{false}; - // If present, indicates that the collection scan will stop and return EOF the first time it // sees a document that does not pass the filter and has a "ts" Timestamp field greater than // 'maxTs'. diff --git a/src/mongo/db/ops/write_ops_exec.cpp b/src/mongo/db/ops/write_ops_exec.cpp index 954479180c3..5176503ef73 100644 --- a/src/mongo/db/ops/write_ops_exec.cpp +++ b/src/mongo/db/ops/write_ops_exec.cpp @@ -651,7 +651,7 @@ static SingleWriteResult performSingleUpdateOp(OperationContext* opCtx, PlanSummaryStats summary; Explain::getSummaryStats(*exec, &summary); if (collection->getCollection()) { - collection->getCollection()->infoCache()->notifyOfQuery(opCtx, summary); + collection->getCollection()->infoCache()->notifyOfQuery(opCtx, summary.indexesUsed); } if (curOp.shouldDBProfile()) { @@ -892,7 +892,7 @@ static SingleWriteResult performSingleDeleteOp(OperationContext* opCtx, PlanSummaryStats summary; Explain::getSummaryStats(*exec, &summary); if (collection.getCollection()) { - collection.getCollection()->infoCache()->notifyOfQuery(opCtx, summary); + collection.getCollection()->infoCache()->notifyOfQuery(opCtx, summary.indexesUsed); } curOp.debug().setPlanSummaryMetrics(summary); diff --git a/src/mongo/db/pipeline/document_source_coll_stats.cpp b/src/mongo/db/pipeline/document_source_coll_stats.cpp index a02a6018231..df6063dad52 100644 --- a/src/mongo/db/pipeline/document_source_coll_stats.cpp +++ b/src/mongo/db/pipeline/document_source_coll_stats.cpp @@ -85,17 +85,6 @@ intrusive_ptr<DocumentSource> DocumentSourceCollStats::createFromBson( << " of type " << typeName(elem.type()), elem.type() == BSONType::Object); - } else if ("queryExecStats" == fieldName) { - uassert(31141, - str::stream() << "queryExecStats argument must be an empty object, but got " - << elem - << " of type " - << typeName(elem.type()), - elem.type() == BSONType::Object); - uassert(31170, - str::stream() << "queryExecStats argument must be an empty object, but got " - << elem, - elem.embeddedObject().isEmpty()); } else { uasserted(40168, str::stream() << "unrecognized option to $collStats: " << fieldName); } @@ -160,16 +149,6 @@ DocumentSource::GetNextResult DocumentSourceCollStats::getNext() { } } - if (_collStatsSpec.hasField("queryExecStats")) { - Status status = pExpCtx->mongoProcessInterface->appendQueryExecStats( - pExpCtx->opCtx, pExpCtx->ns, &builder); - if (!status.isOK()) { - uasserted(31142, - str::stream() << "Unable to retrieve queryExecStats in $collStats stage: " - << status.reason()); - } - } - return {Document(builder.obj())}; } diff --git a/src/mongo/db/pipeline/document_source_cursor.cpp b/src/mongo/db/pipeline/document_source_cursor.cpp index f4e53f20d16..1d971d188a8 100644 --- a/src/mongo/db/pipeline/document_source_cursor.cpp +++ b/src/mongo/db/pipeline/document_source_cursor.cpp @@ -322,7 +322,7 @@ DocumentSourceCursor::DocumentSourceCursor( } if (collection) { - collection->infoCache()->notifyOfQuery(pExpCtx->opCtx, _planSummaryStats); + collection->infoCache()->notifyOfQuery(pExpCtx->opCtx, _planSummaryStats.indexesUsed); } } diff --git a/src/mongo/db/pipeline/mongo_process_interface.h b/src/mongo/db/pipeline/mongo_process_interface.h index 4e4165d29f3..ae7e707e3e9 100644 --- a/src/mongo/db/pipeline/mongo_process_interface.h +++ b/src/mongo/db/pipeline/mongo_process_interface.h @@ -195,12 +195,6 @@ public: virtual Status appendRecordCount(OperationContext* opCtx, const NamespaceString& nss, BSONObjBuilder* builder) const = 0; - /** - * Appends the exec stats for the collection 'nss' to 'builder'. - */ - virtual Status appendQueryExecStats(OperationContext* opCtx, - const NamespaceString& nss, - BSONObjBuilder* builder) const = 0; /** * Gets the collection options for the collection given by 'nss'. Throws diff --git a/src/mongo/db/pipeline/mongos_process_interface.h b/src/mongo/db/pipeline/mongos_process_interface.h index fcfe82d6321..39c69b2daf7 100644 --- a/src/mongo/db/pipeline/mongos_process_interface.h +++ b/src/mongo/db/pipeline/mongos_process_interface.h @@ -144,12 +144,6 @@ public: MONGO_UNREACHABLE; } - Status appendQueryExecStats(OperationContext* opCtx, - const NamespaceString& nss, - BSONObjBuilder* builder) const final { - MONGO_UNREACHABLE; - } - BSONObj getCollectionOptions(const NamespaceString& nss) final { MONGO_UNREACHABLE; } diff --git a/src/mongo/db/pipeline/process_interface_standalone.cpp b/src/mongo/db/pipeline/process_interface_standalone.cpp index 6e13e969ac4..d7a51028503 100644 --- a/src/mongo/db/pipeline/process_interface_standalone.cpp +++ b/src/mongo/db/pipeline/process_interface_standalone.cpp @@ -282,39 +282,6 @@ Status MongoInterfaceStandalone::appendRecordCount(OperationContext* opCtx, return appendCollectionRecordCount(opCtx, nss, builder); } -Status MongoInterfaceStandalone::appendQueryExecStats(OperationContext* opCtx, - const NamespaceString& nss, - BSONObjBuilder* builder) const { - AutoGetCollectionForReadCommand autoColl(opCtx, nss); - - if (!autoColl.getDb()) { - return {ErrorCodes::NamespaceNotFound, - str::stream() << "Database [" << nss.db().toString() << "] not found."}; - } - - Collection* collection = autoColl.getCollection(); - - if (!collection) { - return {ErrorCodes::NamespaceNotFound, - str::stream() << "Collection [" << nss.toString() << "] not found."}; - } - - auto collectionScanStats = collection->infoCache()->getCollectionScanStats(); - - dassert(collectionScanStats.collectionScans <= - static_cast<unsigned long long>(std::numeric_limits<long long>::max())); - dassert(collectionScanStats.collectionScansNonTailable <= - static_cast<unsigned long long>(std::numeric_limits<long long>::max())); - builder->append("queryExecStats", - BSON("collectionScans" << BSON( - "total" << static_cast<long long>(collectionScanStats.collectionScans) - << "nonTailable" - << static_cast<long long>( - collectionScanStats.collectionScansNonTailable)))); - - return Status::OK(); -} - BSONObj MongoInterfaceStandalone::getCollectionOptions(const NamespaceString& nss) { const auto infos = _client.getCollectionInfos(nss.db().toString(), BSON("name" << nss.coll())); if (infos.empty()) { diff --git a/src/mongo/db/pipeline/process_interface_standalone.h b/src/mongo/db/pipeline/process_interface_standalone.h index 8d7cf4693c4..1569e090c89 100644 --- a/src/mongo/db/pipeline/process_interface_standalone.h +++ b/src/mongo/db/pipeline/process_interface_standalone.h @@ -88,9 +88,6 @@ public: Status appendRecordCount(OperationContext* opCtx, const NamespaceString& nss, BSONObjBuilder* builder) const final; - Status appendQueryExecStats(OperationContext* opCtx, - const NamespaceString& nss, - BSONObjBuilder* builder) const final override; BSONObj getCollectionOptions(const NamespaceString& nss) final; void renameIfOptionsAndIndexesHaveNotChanged(OperationContext* opCtx, const BSONObj& renameCommandObj, diff --git a/src/mongo/db/pipeline/stub_mongo_process_interface.h b/src/mongo/db/pipeline/stub_mongo_process_interface.h index 82950fdc427..a8a4a02e1e4 100644 --- a/src/mongo/db/pipeline/stub_mongo_process_interface.h +++ b/src/mongo/db/pipeline/stub_mongo_process_interface.h @@ -106,12 +106,6 @@ public: MONGO_UNREACHABLE; } - Status appendQueryExecStats(OperationContext* opCtx, - const NamespaceString& nss, - BSONObjBuilder* builder) const override { - MONGO_UNREACHABLE; - } - BSONObj getCollectionOptions(const NamespaceString& nss) override { MONGO_UNREACHABLE; } diff --git a/src/mongo/db/query/explain.cpp b/src/mongo/db/query/explain.cpp index eb109928be4..709d8ffda4a 100644 --- a/src/mongo/db/query/explain.cpp +++ b/src/mongo/db/query/explain.cpp @@ -34,7 +34,6 @@ #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" @@ -1016,13 +1015,6 @@ 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++; } } } diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp index f9de0152b5c..8f4132b1eaf 100644 --- a/src/mongo/db/query/find.cpp +++ b/src/mongo/db/query/find.cpp @@ -150,7 +150,7 @@ void endQueryOp(OperationContext* opCtx, curOp->debug().setPlanSummaryMetrics(summaryStats); if (collection) { - collection->infoCache()->notifyOfQuery(opCtx, summaryStats); + collection->infoCache()->notifyOfQuery(opCtx, summaryStats.indexesUsed); } if (curOp->shouldDBProfile()) { diff --git a/src/mongo/db/query/plan_summary_stats.h b/src/mongo/db/query/plan_summary_stats.h index a0ded1f2755..35deb4d83c0 100644 --- a/src/mongo/db/query/plan_summary_stats.h +++ b/src/mongo/db/query/plan_summary_stats.h @@ -50,14 +50,6 @@ struct PlanSummaryStats { // The number of milliseconds spent inside the root stage's work() method. long long executionTimeMillis = 0; - // The number of collection scans that occur during execution. Note that more than one - // collection scan may happen during execution (e.g. for $lookup execution). - long long collectionScans = 0; - - // The number of collection scans that occur during execution which are nontailable. Note that - // more than one collection scan may happen during execution (e.g. for $lookup execution). - long long collectionScansNonTailable = 0; - // Did this plan use an in-memory sort stage? bool hasSortStage = false; |