@Override
  public int getSizeEstimate(ExecutionContext context) throws FunctionDomainException,
      TypeMismatchException, NameResolutionException, QueryInvocationTargetException {
    IndexInfo[] idxInfo = getIndexInfo(context);

    // Both operands are indexed, evaluate it first in the filter operand.
    if (idxInfo != null && idxInfo.length > 1) {
      return 0;
    }

    // Asif: This implies it is an independent condition. So evaluate it second in filter operand.
    if (idxInfo == null) {
      return 1;
    }

    assert idxInfo.length == 1;
    Object key = idxInfo[0].evaluateIndexKey(context);

    // Key not found (indexes have mapping for UNDEFINED), evaluation is fast so do it first.
    if (key != null && key.equals(QueryService.UNDEFINED)) {
      return 0;
    }

    if (context instanceof QueryExecutionContext) {
      QueryExecutionContext qcontext = (QueryExecutionContext) context;
      if (qcontext.isHinted(idxInfo[0]._index.getName())) {
        return qcontext.getHintSize(idxInfo[0]._index.getName());
      }
    }
    // if the key is the LEFT operand, then reflect the operator
    // before the index lookup
    int op = reflectOnOperator(idxInfo[0]._key());

    return idxInfo[0]._index.getSizeEstimate(key, op, idxInfo[0]._matchLevel);
  }
evaluate as a filter, producing an intermediate result set. This may require iteration if there
is no index available. Asif :The booelan true implies that CompiledComparsion when existing on
its own always requires a Completeexpansion to top level iterators. This flag can get toggled
to false only from inside a GroupJunction

@param intermediateResults if this parameter is provided, and we have to iterate, then iterate
       over this result set instead of the entire base collection.
geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledComparison.java