private void privSetIndexInfo(IndexInfo[] indexInfo, ExecutionContext context) { context.cachePut(this, indexInfo); }
private void privSetIndexInfo(IndexInfo[] indexInfo, ExecutionContext context) { context.cachePut(this, indexInfo); }
private void privSetIndexInfo(IndexInfo[] indexInfo, ExecutionContext context) { context.cachePut(this, indexInfo); }
context.cachePut(CompiledValue.CAN_APPLY_LIMIT_AT_INDEX, Boolean.FALSE); Boolean originalCanApplyOrderBy = (Boolean) context.cacheGet(CompiledValue.CAN_APPLY_ORDER_BY_AT_INDEX); context.cachePut(CompiledValue.CAN_APPLY_ORDER_BY_AT_INDEX, Boolean.FALSE); context.cachePut(CompiledValue.CAN_APPLY_LIMIT_AT_INDEX, originalCanApplyLimit); context.cachePut(CompiledValue.CAN_APPLY_ORDER_BY_AT_INDEX, originalCanApplyOrderBy); ObjectType ot = indexInfo._index.getResultSetType();
@Override public Set computeDependencies(ExecutionContext context) throws TypeMismatchException, AmbiguousNameException, NameResolutionException { List args = this.args; Iterator i = args.iterator(); while (i.hasNext()) { context.addDependencies(this, ((CompiledValue) i.next()).computeDependencies(context)); } CompiledValue rcvr = getReceiver(context); if (rcvr == null) // implicit iterator operation { // see if it's an implicit operation name RuntimeIterator rcvrItr = context.resolveImplicitOperationName(this.methodName, this.args.size(), true); if (rcvrItr == null) { // no receiver resolved // function call: no functions implemented except keywords in the grammar throw new TypeMismatchException( String.format("Could not resolve method named ' %s '", this.methodName)); } // cache the receiver so we don't have to resolve it again context.cachePut(this, rcvrItr); return context.addDependency(this, rcvrItr); } // receiver is explicit return context.addDependencies(this, rcvr.computeDependencies(context)); }
/** * We retrieve the collection from the context cache if it exists This allows us to not have to * reevaluate the sub query on every iteration. This improves performance for queries such as * "select * from /receipts r where r.type = 'large' and r.id in (select c.id from /customers c * where c.status = 'preferred') The sub query would create a set that would not change and store * it into the context if it does not yet exist */ private Object evaluateColln(ExecutionContext context) throws QueryInvocationTargetException, NameResolutionException, TypeMismatchException, FunctionDomainException { Object evalColln = null; if (this.colln.isDependentOnCurrentScope(context)) { evalColln = this.colln.evaluate(context); } else { evalColln = context.cacheGet(this.colln); if (evalColln == null) { evalColln = this.colln.evaluate(context); context.cachePut(this.colln, evalColln); } } return evalColln; }
private void queryIndex(Object key, IndexInfo indexInfo, SelectResults results, CompiledValue iterOperands, RuntimeIterator[] indpndntItrs, ExecutionContext context, List projAttrib, boolean conditioningNeeded) throws TypeMismatchException, FunctionDomainException, NameResolutionException, QueryInvocationTargetException { assert indexInfo != null; assert indexInfo._index != null; // Get new IndexInfo to put in context as we dont want it to evaluate // key collection again if its a CompiledSelect (Nested Query). IndexInfo contextIndexInfo = new IndexInfo(new CompiledLiteral(key), indexInfo._path(), indexInfo._getIndex(), 0, null, indexInfo._operator()); context.cachePut(CompiledValue.INDEX_INFO, contextIndexInfo); indexInfo._index.query(key, TOK_EQ, results, !conditioningNeeded ? iterOperands : null, indpndntItrs == null ? null : indpndntItrs[0], context, projAttrib, null, false); }
context.cachePut(this, rIter); return rIter;
context.cachePut(QUERY_INDEX_HINTS, hints); StringBuilder preferredIndexCondn = new StringBuilder(); this.evalCanonicalizedExpressionForCSC(csc, context, preferredIndexCondn); context.cachePut(PREF_INDEX_COND, preferredIndexCondn.toString()); context.cachePut(this.whereClause, CLAUSE_EVALUATED); if (limitValue >= 0 && numInd == 1 && ((Filter) this.whereClause).isLimitApplicableAtIndexLevel(context)) { context.cachePut(CAN_APPLY_LIMIT_AT_INDEX, Boolean.TRUE); if (temp != null && numInd == 1 && ((Filter) this.whereClause) .isOrderByApplicableAtIndexLevel(context, temp.toString())) { context.cachePut(CAN_APPLY_ORDER_BY_AT_INDEX, Boolean.TRUE); context.cachePut(ORDERBY_ATTRIB, this.orderByAttrs); canApplyOrderByAtIndex = true; if (this.orderByAttrs.size() == 1) { context.cachePut(CAN_APPLY_LIMIT_AT_INDEX, Boolean.FALSE); context.cachePut(RESULT_LIMIT, limitValue); if (numInd == 1 && ((Filter) this.whereClause).isProjectionEvaluationAPossibility(context) context.cachePut(RESULT_TYPE, resultType); context.cachePut(PROJ_ATTRIB, this.projAttrs);
throws TypeMismatchException, NameResolutionException { context.cachePut(scopeID, context.associateScopeID()); context.newScope((Integer) context.cacheGet(scopeID)); context.pushExecCache((Integer) context.cacheGet(scopeID));
context.cachePut(CompiledValue.CAN_APPLY_LIMIT_AT_INDEX, Boolean.FALSE); QueryObserver observer = QueryObserverHolder.getInstance(); observer.beforeIndexLookup(this.indxInfo._index, this.greaterCondnOp, this.greaterCondnKey, this.lessCondnOp, this.lessCondnKey, this.notEqualTypeKeys); context.cachePut(CompiledValue.INDEX_INFO, this.indxInfo); this.indxInfo._index.query(this.greaterCondnKey, this.greaterCondnOp, this.lessCondnKey, this.lessCondnOp, set, notEqualTypeKeys, context);
new IndexInfo(cc.getKey(context), thisIndexInfo[0]._path, thisIndexInfo[0]._index, thisIndexInfo[0]._matchLevel, thisIndexInfo[0].mapping, cc.getOperator()); context.cachePut(cc, new IndexInfo[] {indexInfo});
observer.beforeIndexLookup(this.indxInfo._index, OQLLexerTokenTypes.TOK_NE, this.notEqualTypeKeys); context.cachePut(CompiledValue.INDEX_INFO, this.indxInfo); this.indxInfo._index.query(set, notEqualTypeKeys, context); } finally {
context.cachePut(CompiledValue.INDEX_INFO, this.indxInfo); this.indxInfo._index.query(this.condnKey, this.condnOp, set, notEqualTypeKeys, context); } finally {
context.cachePut(CompiledValue.INDEX_INFO, indxInfo);