示例#1
0
 void CanonicalQuery::generateCacheKey(void) {
     mongoutils::str::stream ss;
     encodePlanCacheKeyTree(_root.get(), &ss);
     encodePlanCacheKeySort(_pq->getSort(), &ss);
     encodePlanCacheKeyProj(_pq->getProj(), &ss);
     _cacheKey = ss;
 }
示例#2
0
 PlanCacheKey PlanCache::computeKey(const CanonicalQuery& cq) const {
     str::stream ss;
     encodePlanCacheKeyTree(cq.root(), &ss);
     encodePlanCacheKeySort(cq.getParsed().getSort(), &ss);
     encodePlanCacheKeyProj(cq.getParsed().getProj(), &ss);
     return ss;
 }
示例#3
0
 /**
  * Cache key is a string-ified combination of the query and sort obfuscated
  * for minimal user comprehension.
  */
 PlanCacheKey PlanCache::getPlanCacheKey(const CanonicalQuery& query) {
     stringstream ss;
     encodePlanCacheKeyTree(query.root(), &ss);
     encodePlanCacheKeySort(query.getParsed().getSort(), &ss);
     encodePlanCacheKeyProj(query.getParsed().getProj(), &ss);
     PlanCacheKey key(ss.str());
     return key;
 }