summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog
diff options
context:
space:
mode:
authorXiangyu Yao <xiangyu.yao@mongodb.com>2019-07-10 18:38:03 -0400
committerXiangyu Yao <xiangyu.yao@mongodb.com>2019-07-10 18:38:03 -0400
commitcb3b6c8b2a28190560906db4d78ef833eec44425 (patch)
tree8f550393c99b15f4b27d9bbb27115fc451930be7 /src/mongo/db/catalog
parenta4ef14ef41f0700ef07e5b57b0345d2396a44604 (diff)
downloadmongo-cb3b6c8b2a28190560906db4d78ef833eec44425.tar.gz
Revert "SERVER-40755 Expose statistics which indicate how many collection scans have executed"
This reverts commit a4ef14ef41f0700ef07e5b57b0345d2396a44604.
Diffstat (limited to 'src/mongo/db/catalog')
-rw-r--r--src/mongo/db/catalog/collection_info_cache.h13
-rw-r--r--src/mongo/db/catalog/collection_info_cache_impl.cpp12
-rw-r--r--src/mongo/db/catalog/collection_info_cache_impl.h8
3 files changed, 8 insertions, 25 deletions
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;