public abstract class BaseIndex extends SchemaObjectBase implements Index
| 限定符和类型 | 字段和说明 |
|---|---|
protected int[] |
columnIds |
protected Column[] |
columns |
protected IndexColumn[] |
indexColumns |
protected IndexType |
indexType |
protected boolean |
isMultiVersion |
protected Table |
table |
comment, database, traceAGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE| 构造器和说明 |
|---|
BaseIndex() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
canFindNext()
Check if the index can get the next higher value.
|
boolean |
canScan()
Can this index iterate over all rows?
|
protected static void |
checkIndexColumnTypes(IndexColumn[] columns)
Check that the index columns are not CLOB or BLOB.
|
void |
commit(int operation,
Row row)
Commit the operation for a row.
|
int |
compareRows(SearchRow rowData,
SearchRow compare)
Compare two rows.
|
protected boolean |
containsNullAndAllowMultipleNull(SearchRow newRow)
Check if one of the columns is NULL and multiple rows with NULL are
allowed using the current compatibility mode for unique indexes.
|
IndexLookupBatch |
createLookupBatch(TableFilter[] filters,
int filter)
Creates new lookup batch.
|
Cursor |
find(TableFilter filter,
SearchRow first,
SearchRow last)
Find a row or a list of rows and create a cursor to iterate over the
result.
|
Cursor |
findNext(Session session,
SearchRow higherThan,
SearchRow last)
Find a row or a list of rows that is larger and create a cursor to
iterate over the result.
|
int |
getColumnIndex(Column col)
Get the index of a column in the list of index columns
|
Column[] |
getColumns()
Get the indexed columns.
|
protected long |
getCostRangeIndex(int[] masks,
long rowCount,
TableFilter[] filters,
int filter,
SortOrder sortOrder,
boolean isScanIndex,
HashSet<Column> allColumnsSet)
Calculate the cost for the given mask as if this index was a typical
b-tree range index.
|
String |
getCreateSQL()
Build a SQL statement to re-create this object.
|
String |
getCreateSQLForCopy(Table targetTable,
String quotedName)
Build a SQL statement to re-create the object, or to create a copy of the
object with a different name or referencing a different table
|
String |
getDropSQL()
Build a SQL statement to drop this object.
|
protected DbException |
getDuplicateKeyException(String key)
Create a duplicate key exception with a message that contains the index
name.
|
IndexColumn[] |
getIndexColumns()
Get the indexed columns as index columns (with ordering information).
|
IndexType |
getIndexType()
Get the index type.
|
String |
getPlanSQL()
Get the message to show in a EXPLAIN statement.
|
Row |
getRow(Session session,
long key)
Get the row with the given key.
|
Table |
getTable()
Get the table on which this index is based.
|
int |
getType()
Get the object type.
|
protected void |
initBaseIndex(Table newTable,
int id,
String name,
IndexColumn[] newIndexColumns,
IndexType newIndexType)
Initialize the base index.
|
boolean |
isHidden()
Check whether this is a hidden object that doesn't appear in the meta
data and in the script, and is not dropped on DROP ALL OBJECTS.
|
boolean |
isRowIdIndex()
Does this index support lookup by row id?
|
void |
removeChildrenAndResources(Session session)
Remove all dependent objects and free all resources (files, blocks in
files) of this object.
|
void |
setSortedInsertMode(boolean sortedInsertMode)
Enable or disable the 'sorted insert' optimizations (rows are inserted in
ascending or descending order) if applicable for this index
implementation.
|
getSchema, getSQL, initSchemaObjectBasecheckRename, getChildren, getComment, getDatabase, getId, getModificationId, getName, initDbObjectBase, invalidate, isTemporary, isValid, rename, setComment, setModified, setObjectName, setTemporary, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitadd, canGetFirstOrLast, close, find, findFirstOrLast, getCost, getDiskSpaceUsed, getRowCount, getRowCountApproximation, needRebuild, remove, remove, truncategetSchemacheckRename, getChildren, getComment, getDatabase, getId, getName, getSQL, isTemporary, rename, setComment, setTemporaryprotected IndexColumn[] indexColumns
protected Column[] columns
protected int[] columnIds
protected Table table
protected IndexType indexType
protected boolean isMultiVersion
protected void initBaseIndex(Table newTable, int id, String name, IndexColumn[] newIndexColumns, IndexType newIndexType)
newTable - the tableid - the object idname - the index namenewIndexColumns - the columns that are indexed or null if this is
not yet knownnewIndexType - the index typeprotected static void checkIndexColumnTypes(IndexColumn[] columns)
columns - the columnspublic String getDropSQL()
DbObjectBasegetDropSQL 在接口中 DbObjectgetDropSQL 在类中 DbObjectBaseprotected DbException getDuplicateKeyException(String key)
key - the key valuespublic String getPlanSQL()
IndexgetPlanSQL 在接口中 Indexpublic void removeChildrenAndResources(Session session)
DbObjectBaseremoveChildrenAndResources 在接口中 DbObjectremoveChildrenAndResources 在类中 DbObjectBasesession - the sessionpublic boolean canFindNext()
IndexcanFindNext 在接口中 Indexpublic Cursor find(TableFilter filter, SearchRow first, SearchRow last)
Indexpublic Cursor findNext(Session session, SearchRow higherThan, SearchRow last)
findNext 在接口中 Indexsession - the sessionhigherThan - the lower limit (excluding)last - the last row, or null for no limitDbException - alwaysprotected final long getCostRangeIndex(int[] masks,
long rowCount,
TableFilter[] filters,
int filter,
SortOrder sortOrder,
boolean isScanIndex,
HashSet<Column> allColumnsSet)
masks - the IndexCondition search masks, one for each column in the
tablerowCount - the number of rows in the indexfilters - all joined table filtersfilter - the current table filter indexsortOrder - the sort orderisScanIndex - whether this is a "table scan" indexallColumnsSet - the set of all columnspublic int compareRows(SearchRow rowData, SearchRow compare)
IndexcompareRows 在接口中 IndexrowData - the first rowcompare - the second rowprotected boolean containsNullAndAllowMultipleNull(SearchRow newRow)
newRow - the row to checkpublic int getColumnIndex(Column col)
IndexgetColumnIndex 在接口中 Indexcol - the columnpublic String getCreateSQLForCopy(Table targetTable, String quotedName)
DbObjectgetCreateSQLForCopy 在接口中 DbObjecttargetTable - the new tablequotedName - the quoted namepublic String getCreateSQL()
DbObjectBasegetCreateSQL 在接口中 DbObjectgetCreateSQL 在类中 DbObjectBasepublic IndexColumn[] getIndexColumns()
IndexgetIndexColumns 在接口中 Indexpublic Column[] getColumns()
IndexgetColumns 在接口中 Indexpublic IndexType getIndexType()
IndexgetIndexType 在接口中 Indexpublic int getType()
DbObjectpublic void commit(int operation,
Row row)
Indexpublic boolean isHidden()
SchemaObjectisHidden 在接口中 SchemaObjectisHidden 在类中 SchemaObjectBasepublic boolean isRowIdIndex()
IndexisRowIdIndex 在接口中 Indexpublic boolean canScan()
Indexpublic void setSortedInsertMode(boolean sortedInsertMode)
IndexsetSortedInsertMode 在接口中 IndexsortedInsertMode - the new valuepublic IndexLookupBatch createLookupBatch(TableFilter[] filters, int filter)
IndexIndexLookupBatch
instance can be used multiple times.createLookupBatch 在接口中 Indexfilters - the table filtersfilter - the filter index (0, 1,...)null if batched lookup is not supported
by this index.Copyright © 2017. All rights reserved.