private void removeFromMatchingCqMap(CqQueryImpl cq) {
    synchronized (matchingCqMap) {
      String cqQuery = cq.getQueryString();
      if (matchingCqMap.containsKey(cqQuery)) {
        Set matchingCQs = matchingCqMap.get(cqQuery);
        matchingCQs.remove(cq.getServerCqName());
        if (logger.isDebugEnabled()) {
          logger.debug(
              "Removing CQ from MatchingCQ map, CQName: {} Number of matched querys are: {}",
              cq.getServerCqName(), matchingCQs.size());
        }
        if (matchingCQs.isEmpty()) {
          matchingCqMap.remove(cqQuery);
          stats.decUniqueCqQuery();
        }
      }
    }
  }
Removes the query from the given CQ from the matched CQ map.
geode-cq/src/main/java/org/apache/geode/cache/query/cq/internal/CqServiceImpl.java