@Override public synchronized void afterCompletion(int status) { completed = true; synchronizations.remove(id); if (transactionMode == TransactionMode.ISOLATE_READS) { for (TempTable table : tables.values()) { table.getActive().decrementAndGet(); } } else { HashSet<TempTable> current = new HashSet<TempTable>(tempTables.values()); current.retainAll(tables.values()); for (TempTable table : current) { table.getActive().set(0); table.getTree().clearClonedFlags(); } } for (TransactionCallback callback : callbacks) { if (status == Status.STATUS_COMMITTED) { callback.commit(); } else { callback.rollback(); } } callbacks.clear(); }
@Override public synchronized void afterCompletion(int status) { completed = true; synchronizations.remove(id); if (transactionMode == TransactionMode.ISOLATE_READS) { for (TempTable table : tables.values()) { table.getActive().decrementAndGet(); } } else { HashSet<TempTable> current = new HashSet<TempTable>(tempTables.values()); current.retainAll(tables.values()); for (TempTable table : current) { table.getActive().set(0); table.getTree().clearClonedFlags(); } } for (TransactionCallback callback : callbacks) { if (status == Status.STATUS_COMMITTED) { callback.commit(); } else { callback.rollback(); } } callbacks.clear(); }
void addIndex(List<ElementSymbol> indexColumns, boolean unique) throws TeiidComponentException, TeiidProcessingException { List<ElementSymbol> keyColumns = columns.subList(0, tree.getKeyLength()); if (keyColumns.equals(indexColumns) || (indexTables != null && indexTables.containsKey(indexColumns))) { return; } TempTable indexTable = createIndexTable(indexColumns, unique); //TODO: ordered insert optimization TupleSource ts = createTupleSource(indexTable.getColumns(), null, null); indexTable.insert(ts, indexTable.getColumns(), false, false, null); indexTable.getTree().compact(); }
@Override public synchronized void afterCompletion(int status) { completed = true; synchronizations.remove(id); if (transactionMode == TransactionMode.ISOLATE_READS) { for (TempTable table : tables.values()) { table.getActive().decrementAndGet(); } } else { HashSet<TempTable> current = new HashSet<TempTable>(tempTables.values()); current.retainAll(tables.values()); for (TempTable table : current) { table.getActive().set(0); table.getTree().clearClonedFlags(); } } for (TransactionCallback callback : callbacks) { if (status == Status.STATUS_COMMITTED) { callback.commit(); } else { callback.rollback(); } } callbacks.clear(); }
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); }
void addIndex(List<ElementSymbol> indexColumns, boolean unique) throws TeiidComponentException, TeiidProcessingException { List<ElementSymbol> keyColumns = columns.subList(0, tree.getKeyLength()); if (keyColumns.equals(indexColumns) || (indexTables != null && indexTables.containsKey(indexColumns))) { return; } TempTable indexTable = createIndexTable(indexColumns, unique); //TODO: ordered insert optimization TupleSource ts = createTupleSource(indexTable.getColumns(), null, null); indexTable.insert(ts, indexTable.getColumns(), false, false, null); indexTable.getTree().compact(); }
void addIndex(List<ElementSymbol> indexColumns, boolean unique) throws TeiidComponentException, TeiidProcessingException { List<ElementSymbol> keyColumns = columns.subList(0, tree.getKeyLength()); if (keyColumns.equals(indexColumns) || (indexTables != null && indexTables.containsKey(indexColumns))) { return; } TempTable indexTable = createIndexTable(indexColumns, unique); //TODO: ordered insert optimization TupleSource ts = createTupleSource(indexTable.getColumns(), null, null); indexTable.insert(ts, indexTable.getColumns(), false, false, null); indexTable.getTree().compact(); }
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); }
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); }
tempTable.getTree().setSaveTemporaryLobs(!localScoped); if (add) { tempTables.put(tempTableName, tempTable);
tempTable.getTree().setSaveTemporaryLobs(!localScoped); if (add) { tempTables.put(tempTableName, tempTable);
if ((indexTables != null || (!this.updatable && allowImplicitIndexing && condition != null && this.getRowCount() > 2*this.getTree().getPageSize(true))) && (condition != null || orderBy != null) && ii.valueSet.size() != 1) { LogManager.logDetail(LogConstants.CTX_DQP, "Considering indexes on table", this, "for query", projectedCols, condition, orderBy); //$NON-NLS-1$ //$NON-NLS-2$ long rowCost = this.tree.getRowCount();
if ((indexTables != null || (!this.updatable && allowImplicitIndexing && condition != null && this.getRowCount() > 2*this.getTree().getPageSize(true))) && (condition != null || orderBy != null) && ii.valueSet.size() != 1) { LogManager.logDetail(LogConstants.CTX_DQP, "Considering indexes on table", this, "for query", projectedCols, condition, orderBy); //$NON-NLS-1$ //$NON-NLS-2$ long rowCost = this.tree.getRowCount();
Assertion.isNotNull(tt, "Table doesn't exist"); //$NON-NLS-1$ tt.setUpdatable(false); if (att.getIndexColumns() != null && tt.getRowCount() > 2*tt.getTree().getPageSize(true)) { for (List<ElementSymbol> cols : att.getIndexColumns()) { tt.addIndex(cols, false);
table.getTree().compact(); rowCount = table.getRowCount(); Determinism determinism = qp.getContext().getDeterminismLevel();
table.getTree().compact(); rowCount = table.getRowCount(); Determinism determinism = qp.getContext().getDeterminismLevel();
table.getTree().compact(); rowCount = table.getRowCount(); Determinism determinism = qp.getContext().getDeterminismLevel();