@Override protected Cursor run() throws Exception { viewIndex.setupQueryParameters(viewIndex.getSession(), first, last, null); ArrayList<JoinBatch> joinBatches = batchUnion.joinBatches; for (int i = 0, size = joinBatches.size(); i < size; i++) { assert topFutureCursors[i] != null; joinBatches.get(i).viewTopFutureCursor = topFutureCursors[i]; } ResultInterface localResult; boolean lazy = false; try { localResult = viewIndex.getQuery().query(0); lazy = localResult.isLazy(); } finally { if (!lazy) { resetViewTopFutureCursorAfterQuery(); } } return newCursor(localResult); }
@Override public final boolean addSearchRows(SearchRow first, SearchRow last) { resetAfterFind(); viewIndex.setupQueryParameters(viewIndex.getSession(), first, last, null); R r; if (resultSize < result.size()) { // get reused runner r = queryRunner(resultSize); } else { // create new runner result.add(r = newQueryRunner()); } r.first = first; r.last = last; if (!collectSearchRows(r)) { r.clear(); return false; } resultSize++; return true; }
@Override protected Cursor run() throws Exception { if (topFutureCursor == null) { // if the top cursor is empty then the whole query will produce // empty result return EMPTY_CURSOR; } viewIndex.setupQueryParameters(viewIndex.getSession(), first, last, null); JoinBatch.this.viewTopFutureCursor = topFutureCursor; ResultInterface localResult; boolean lazy = false; try { localResult = viewIndex.getQuery().query(0); lazy = localResult.isLazy(); } finally { if (!lazy) { resetViewTopFutureCursorAfterQuery(); } } return newCursor(localResult); }
@Override protected Cursor run() throws Exception { viewIndex.setupQueryParameters(viewIndex.getSession(), first, last, null); ArrayList<JoinBatch> joinBatches = batchUnion.joinBatches; for (int i = 0, size = joinBatches.size(); i < size; i++) { assert topFutureCursors[i] != null; joinBatches.get(i).viewTopFutureCursor = topFutureCursors[i]; } LocalResult localResult; try { localResult = viewIndex.getQuery().query(0); } finally { for (int i = 0, size = joinBatches.size(); i < size; i++) { joinBatches.get(i).viewTopFutureCursor = null; } } return newCursor(localResult); } }
@Override protected Cursor run() throws Exception { viewIndex.setupQueryParameters(viewIndex.getSession(), first, last, null); ArrayList<JoinBatch> joinBatches = batchUnion.joinBatches; for (int i = 0, size = joinBatches.size(); i < size; i++) { assert topFutureCursors[i] != null; joinBatches.get(i).viewTopFutureCursor = topFutureCursors[i]; } LocalResult localResult; try { localResult = viewIndex.getQuery().query(0); } finally { for (int i = 0, size = joinBatches.size(); i < size; i++) { joinBatches.get(i).viewTopFutureCursor = null; } } return newCursor(localResult); } }
@Override protected Cursor run() throws Exception { if (topFutureCursor == null) { // if the top cursor is empty then the whole query will produce // empty result return EMPTY_CURSOR; } viewIndex.setupQueryParameters(viewIndex.getSession(), first, last, null); JoinBatch.this.viewTopFutureCursor = topFutureCursor; LocalResult localResult; try { localResult = viewIndex.getQuery().query(0); } finally { JoinBatch.this.viewTopFutureCursor = null; } return newCursor(localResult); } }
@Override public final boolean addSearchRows(SearchRow first, SearchRow last) { resetAfterFind(); viewIndex.setupQueryParameters(viewIndex.getSession(), first, last, null); R r; if (resultSize < result.size()) { // get reused runner r = queryRunner(resultSize); } else { // create new runner result.add(r = newQueryRunner()); } r.first = first; r.last = last; if (!collectSearchRows(r)) { r.clear(); return false; } resultSize++; return true; }
@Override public final boolean addSearchRows(SearchRow first, SearchRow last) { resetAfterFind(); viewIndex.setupQueryParameters(viewIndex.getSession(), first, last, null); R r; if (resultSize < result.size()) { // get reused runner r = queryRunner(resultSize); } else { // create new runner result.add(r = newQueryRunner()); } r.first = first; r.last = last; if (!collectSearchRows(r)) { r.clear(); return false; } resultSize++; return true; }
@Override protected Cursor run() throws Exception { if (topFutureCursor == null) { // if the top cursor is empty then the whole query will produce // empty result return EMPTY_CURSOR; } viewIndex.setupQueryParameters(viewIndex.getSession(), first, last, null); JoinBatch.this.viewTopFutureCursor = topFutureCursor; LocalResult localResult; try { localResult = viewIndex.getQuery().query(0); } finally { JoinBatch.this.viewTopFutureCursor = null; } return newCursor(localResult); } }
public PlanItem getBestPlanItem(Session session, int[] masks) throws SQLException { PlanItem item = new PlanItem(); item.cost = index.getCost(session, masks); IntArray masksArray = new IntArray(masks == null ? new int[0] : masks); ViewIndex i2 = (ViewIndex) indexCache.get(masksArray); if (i2 == null || i2.getSession() != session) { i2 = new ViewIndex(this, index, session, masks); indexCache.put(masksArray, i2); } item.setIndex(i2); return item; }