@Override public int getSizeEstimate(ExecutionContext context) throws FunctionDomainException, TypeMismatchException, NameResolutionException, QueryInvocationTargetException { IndexInfo[] idxInfo = getIndexInfo(context); assert idxInfo.length == 1; if (context instanceof QueryExecutionContext) { QueryExecutionContext qcontext = (QueryExecutionContext) context; if (qcontext.isHinted(idxInfo[0]._index.getName())) { return qcontext.getHintSize(idxInfo[0]._index.getName()); } } int op = _is_defined ? TOK_NE : TOK_EQ; return idxInfo[0]._index.getSizeEstimate(QueryService.UNDEFINED, op, idxInfo[0]._matchLevel); }
QueryExecutionContext qcontext = (QueryExecutionContext) context; if (qcontext.isHinted(idxInfo[0]._index.getName())) { return qcontext.getHintSize(idxInfo[0]._index.getName());
@Override public int getSizeEstimate(ExecutionContext context) throws FunctionDomainException, TypeMismatchException, NameResolutionException, QueryInvocationTargetException { IndexInfo[] idxInfo = getIndexInfo(context); if (idxInfo == null) { // Asif: This implies it is an independent condition. So evaluate it first // in filter operand return 0; } assert idxInfo.length == 1; Object key = idxInfo[0].evaluateIndexKey(context); 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); }