private static Index getIndex(Table t, IndexColumn[] cols, boolean moreColumnOk) { if (t.getIndexes() == null) { return null; } for (Index idx : t.getIndexes()) { if (canUseIndex(idx, t, cols, moreColumnOk)) { return idx; } } return null; }
private static Index getUniqueIndex(Table t, IndexColumn[] cols) { if (t.getIndexes() == null) { return null; } for (Index idx : t.getIndexes()) { if (canUseUniqueIndex(idx, t, cols)) { return idx; } } return null; }
/** {@inheritDoc} */ @Override public ArrayList<Index> getIndexes() { return innerTable().getIndexes(); }
/** * Get an index by name. * * @param indexName the index name to search for * @return the found index */ public Index getIndex(String indexName) { ArrayList<Index> indexes = getIndexes(); if (indexes != null) { for (Index index : indexes) { if (index.getName().equals(indexName)) { return index; } } } throw DbException.get(ErrorCode.INDEX_NOT_FOUND_1, indexName); }
@Override public ArrayList<DbObject> getChildren() { ArrayList<DbObject> children = New.arrayList(); ArrayList<Index> indexes = getIndexes(); if (indexes != null) { children.addAll(indexes); } if (constraints != null) { children.addAll(constraints); } if (triggers != null) { children.addAll(triggers); } if (sequences != null) { children.addAll(sequences); } children.addAll(dependentViews); if (synonyms != null) { children.addAll(synonyms); } ArrayList<Right> rights = database.getAllRights(); for (Right right : rights) { if (right.getGrantedObject() == this) { children.add(right); } } return children; }
/** * Get the primary key index if there is one, or null if there is none. * * @return the primary key index or null */ public Index findPrimaryKey() { ArrayList<Index> indexes = getIndexes(); if (indexes != null) { for (Index idx : indexes) { if (idx.getIndexType().isPrimaryKey()) { return idx; } } } return null; }
ArrayList<Index> indexes = getIndexes(); Index result = null; if (indexes != null) {
ArrayList<Index> indexes = getIndexes(); if (indexes != null) { for (Column col : columnsToDrop) { if (getIndexes().contains(i)) { session.getDatabase().removeSchemaObject(session, i);
private void checkNullable(Table table) { for (Index index : table.getIndexes()) { if (index.getColumnIndex(oldColumn) < 0) { continue; } IndexType indexType = index.getIndexType(); if (indexType.isPrimaryKey() || indexType.isHash()) { throw DbException.get( ErrorCode.COLUMN_IS_PART_OF_INDEX_1, index.getSQL()); } } }
/** * Remove the given index from the list. * * @param index the index to remove */ public void removeIndex(Index index) { ArrayList<Index> indexes = getIndexes(); if (indexes != null) { remove(indexes, index); if (index.getIndexType().isPrimaryKey()) { for (Column col : index.getColumns()) { col.setPrimaryKey(false); } } } }
private Index getGroupSortedIndex() { if (groupIndex == null || groupByExpression == null) { return null; } ArrayList<Index> indexes = topTableFilter.getTable().getIndexes(); if (indexes != null) { for (Index index : indexes) { if (index.getIndexType().isScan()) { continue; } if (index.getIndexType().isHash()) { // does not allow scanning entries continue; } if (isGroupSortedIndex(topTableFilter, index)) { return index; } } } return null; }
if (filter != null) { Table table = filter.getTable(); ArrayList<Index> indexes = table.getIndexes(); Index result = null; if (indexes != null) {
if (database.isMultiVersion()) { ArrayList<Index> indexes = table.getIndexes(); for (Index index : indexes) { index.commit(operation, row);
ArrayList<Index> list = topTableFilter.getTable().getIndexes(); if (list != null) { int[] sortTypes = sort.getSortTypesWithNullPosition();
item.cost, item.getIndex().getPlanSQL()); ArrayList<Index> indexes = getIndexes(); IndexHints indexHints = getIndexHints(filters, filter);
cursor.get(); for (Index index : table.getIndexes()) { if (index != scanIndex && index.canScan()) { cursor = index.find(sysSession, null, null);
final ArrayList<Index> indexes = table.getIndexes(); for (int j = 0; indexes != null && j < indexes.size(); j++) { Index index = indexes.get(j);
continue; ArrayList<Index> indexes = table.getIndexes(); ArrayList<Constraint> constraints = table.getConstraints(); for (int j = 0; indexes != null && j < indexes.size(); j++) {
private static Index getUniqueIndex(Table t, IndexColumn[] cols) { if (t.getIndexes() == null) { return null; } for (Index idx : t.getIndexes()) { if (canUseUniqueIndex(idx, t, cols)) { return idx; } } return null; }
private Index getIndex(Table t, IndexColumn[] cols) { ObjectArray list = t.getIndexes(); for (int i = 0; i < list.size(); i++) { Index index = (Index) list.get(i); if (canUseIndex(index, t, cols)) { return index; } } return null; }