diff options
author | Jason Rassi <rassi@10gen.com> | 2015-04-10 19:52:05 -0400 |
---|---|---|
committer | Jason Rassi <rassi@10gen.com> | 2015-04-22 11:16:40 -0400 |
commit | d187ea1cc67b1975b6a1cbfcca1977598e9ea0c5 (patch) | |
tree | 31a80677506d77677274c97ffeac321e14e71db3 /src/mongo/db/query/query_settings.cpp | |
parent | 88f6f4733bca7c615dd6fedcfc93a24cfa68372a (diff) | |
download | mongo-d187ea1cc67b1975b6a1cbfcca1977598e9ea0c5.tar.gz |
SERVER-17659 Move CQ::getPlanCacheKey() => PlanCache::computeKey()
Includes partial revert of e5f17aaf. In particular, CanonicalQuery
objects no longer pre-generate their PlanCacheKey.
Diffstat (limited to 'src/mongo/db/query/query_settings.cpp')
-rw-r--r-- | src/mongo/db/query/query_settings.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mongo/db/query/query_settings.cpp b/src/mongo/db/query/query_settings.cpp index 8de33cf4db8..6c12dbcc069 100644 --- a/src/mongo/db/query/query_settings.cpp +++ b/src/mongo/db/query/query_settings.cpp @@ -82,12 +82,10 @@ namespace mongo { _clear(); } - bool QuerySettings::getAllowedIndices(const CanonicalQuery& query, + bool QuerySettings::getAllowedIndices(const PlanCacheKey& key, AllowedIndices** allowedIndicesOut) const { invariant(allowedIndicesOut); - const PlanCacheKey& key = query.getPlanCacheKey(); - boost::lock_guard<boost::mutex> cacheLock(_mutex); AllowedIndexEntryMap::const_iterator cacheIter = _allowedIndexEntryMap.find(key); @@ -116,6 +114,7 @@ namespace mongo { } void QuerySettings::setAllowedIndices(const CanonicalQuery& canonicalQuery, + const PlanCacheKey& key, const std::vector<BSONObj>& indexes) { const LiteParsedQuery& lpq = canonicalQuery.getParsed(); const BSONObj& query = lpq.getFilter(); @@ -123,7 +122,6 @@ namespace mongo { const BSONObj& projection = lpq.getProj(); AllowedIndexEntry* entry = new AllowedIndexEntry(query, sort, projection, indexes); - const PlanCacheKey& key = canonicalQuery.getPlanCacheKey(); boost::lock_guard<boost::mutex> cacheLock(_mutex); AllowedIndexEntryMap::iterator i = _allowedIndexEntryMap.find(key); // Replace existing entry. @@ -134,8 +132,7 @@ namespace mongo { _allowedIndexEntryMap[key] = entry; } - void QuerySettings::removeAllowedIndices(const CanonicalQuery& canonicalQuery) { - const PlanCacheKey& key = canonicalQuery.getPlanCacheKey(); + void QuerySettings::removeAllowedIndices(const PlanCacheKey& key) { boost::lock_guard<boost::mutex> cacheLock(_mutex); AllowedIndexEntryMap::iterator i = _allowedIndexEntryMap.find(key); |