private TupleBrowser createTupleBrower(Criteria condition, boolean direction) throws TeiidComponentException { IndexInfo ii = new IndexInfo(this, null, condition, null, true); ii.ordering = direction; return ii.createTupleBrowser(bm.getOptions().getDefaultNullOrder(), false); }
TupleBrowser createTupleBrowser(NullOrder nullOrder, boolean readOnly) throws TeiidComponentException { boolean direction = OrderBy.ASC; if (ordering != null) { LogManager.logDetail(LogConstants.CTX_DQP, "Using index for ordering"); //$NON-NLS-1$ direction = ordering; } if (valueTs != null) { LogManager.logDetail(LogConstants.CTX_DQP, "Using index value set"); //$NON-NLS-1$ return new TupleBrowser(this.table.getTree(), valueTs, direction, readOnly); } if (!valueSet.isEmpty()) { LogManager.logDetail(LogConstants.CTX_DQP, "Using index value set"); //$NON-NLS-1$ sortValueSet(direction, nullOrder); CollectionTupleSource cts = new CollectionTupleSource(valueSet.iterator()); return new TupleBrowser(this.table.getTree(), cts, direction, readOnly); } if (lower != null || upper != null) { LogManager.logDetail(LogConstants.CTX_DQP, "Using index for range query", lower, upper); //$NON-NLS-1$ } return new TupleBrowser(this.table.getTree(), lower, upper, direction, readOnly); }
final Criteria condition, OrderBy orderBy, IndexInfo ii, boolean agg) throws TeiidComponentException, TeiidProcessingException { TupleBrowser browser = ii.createTupleBrowser(bm.getOptions().getDefaultNullOrder(), true); TupleSource ts = new QueryTupleSource(browser, columnMap, agg?getColumns():projectedCols, condition);
IndexInfo primary = new IndexInfo(this, projectedCols, condition, orderBy, true); IndexInfo ii = primary; if (indexTables != null && (condition != null || orderBy != null) && ii.valueSet.size() != 1) { long bestCost = estimateCost(orderBy, ii, rowCost); for (TempTable table : this.indexTables.values()) { IndexInfo secondary = new IndexInfo(table, projectedCols, condition, orderBy, false); long cost = estimateCost(orderBy, secondary, rowCost); if (cost < bestCost) {
TupleBrowser createTupleBrowser(NullOrder nullOrder, boolean readOnly) throws TeiidComponentException { boolean direction = OrderBy.ASC; if (ordering != null) { LogManager.logDetail(LogConstants.CTX_DQP, "Using index for ordering"); //$NON-NLS-1$ direction = ordering; } if (valueTs != null) { LogManager.logDetail(LogConstants.CTX_DQP, "Using index value set"); //$NON-NLS-1$ return new TupleBrowser(this.table.getTree(), valueTs, direction, readOnly); } if (!valueSet.isEmpty()) { LogManager.logDetail(LogConstants.CTX_DQP, "Using index value set"); //$NON-NLS-1$ sortValueSet(direction, nullOrder); CollectionTupleSource cts = new CollectionTupleSource(valueSet.iterator()); return new TupleBrowser(this.table.getTree(), cts, direction, readOnly); } if (lower != null || upper != null) { LogManager.logDetail(LogConstants.CTX_DQP, "Using index for range query", lower, upper); //$NON-NLS-1$ } return new TupleBrowser(this.table.getTree(), lower, upper, direction, readOnly); }
final Criteria condition, OrderBy orderBy, IndexInfo ii, boolean agg) throws TeiidComponentException, TeiidProcessingException { TupleBrowser browser = ii.createTupleBrowser(bm.getOptions().getDefaultNullOrder(), true); TupleSource ts = new QueryTupleSource(browser, columnMap, agg?getColumns():projectedCols, condition);
IndexInfo primary = new IndexInfo(this, projectedCols, condition, orderBy, true); IndexInfo ii = primary; if ((indexTables != null || (!this.updatable && allowImplicitIndexing && condition != null && this.getRowCount() > 2*this.getTree().getPageSize(true))) && (condition != null || orderBy != null) && ii.valueSet.size() != 1) { if (this.indexTables != null) { for (TempTable table : this.indexTables.values()) { IndexInfo secondary = new IndexInfo(table, projectedCols, condition, orderBy, false); long cost = estimateCost(orderBy, secondary, rowCost); if (cost < bestCost) { IndexInfo secondary = new IndexInfo(this.indexTables.values().iterator().next(), projectedCols, condition, orderBy, false); LogManager.logDetail(LogConstants.CTX_DQP, "Created an implicit index ", secondary.table); //$NON-NLS-1$ long cost = estimateCost(orderBy, secondary, rowCost);
private TupleBrowser createTupleBrower(Criteria condition, boolean direction) throws TeiidComponentException { IndexInfo ii = new IndexInfo(this, null, condition, null, true); ii.ordering = direction; return ii.createTupleBrowser(bm.getOptions().getDefaultNullOrder(), false); }
TupleBrowser createTupleBrowser(NullOrder nullOrder, boolean readOnly) throws TeiidComponentException { boolean direction = OrderBy.ASC; if (ordering != null) { LogManager.logDetail(LogConstants.CTX_DQP, "Using index for ordering"); //$NON-NLS-1$ direction = ordering; } if (valueTs != null) { LogManager.logDetail(LogConstants.CTX_DQP, "Using index value set"); //$NON-NLS-1$ return new TupleBrowser(this.table.getTree(), valueTs, direction, readOnly); } if (!valueSet.isEmpty()) { LogManager.logDetail(LogConstants.CTX_DQP, "Using index value set"); //$NON-NLS-1$ sortValueSet(direction, nullOrder); CollectionTupleSource cts = new CollectionTupleSource(valueSet.iterator()); return new TupleBrowser(this.table.getTree(), cts, direction, readOnly); } if (lower != null || upper != null) { LogManager.logDetail(LogConstants.CTX_DQP, "Using index for range query", lower, upper); //$NON-NLS-1$ } return new TupleBrowser(this.table.getTree(), lower, upper, direction, readOnly); }
final Criteria condition, OrderBy orderBy, IndexInfo ii, boolean agg) throws TeiidComponentException, TeiidProcessingException { TupleBrowser browser = ii.createTupleBrowser(bm.getOptions().getDefaultNullOrder(), true); TupleSource ts = new QueryTupleSource(browser, columnMap, agg?getColumns():projectedCols, condition);
IndexInfo primary = new IndexInfo(this, projectedCols, condition, orderBy, true); IndexInfo ii = primary; if ((indexTables != null || (!this.updatable && allowImplicitIndexing && condition != null && this.getRowCount() > 2*this.getTree().getPageSize(true))) && (condition != null || orderBy != null) && ii.valueSet.size() != 1) { if (this.indexTables != null) { for (TempTable table : this.indexTables.values()) { IndexInfo secondary = new IndexInfo(table, projectedCols, condition, orderBy, false); long cost = estimateCost(orderBy, secondary, rowCost); if (cost < bestCost) { IndexInfo secondary = new IndexInfo(this.indexTables.values().iterator().next(), projectedCols, condition, orderBy, false); LogManager.logDetail(LogConstants.CTX_DQP, "Created an implicit index ", secondary.table); //$NON-NLS-1$ long cost = estimateCost(orderBy, secondary, rowCost);
private TupleBrowser createTupleBrower(Criteria condition, boolean direction) throws TeiidComponentException { IndexInfo ii = new IndexInfo(this, null, condition, null, true); ii.ordering = direction; return ii.createTupleBrowser(bm.getOptions().getDefaultNullOrder(), false); }