class CompiledComparison extends AbstractCompiledValue implements Negatable, OQLLexerTokenTypes, Indexable {

  @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);
  }

    CompiledComparison(CompiledValue left, CompiledValue right, int op);

}