|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.h2.engine.DbObjectBase
org.h2.schema.SchemaObjectBase
org.h2.index.BaseIndex
public abstract class BaseIndex
Most index implementations extend the base index.
| Field Summary | |
|---|---|
protected int[] |
columnIds
|
protected Column[] |
columns
|
protected IndexColumn[] |
indexColumns
|
protected IndexType |
indexType
|
protected boolean |
isMultiVersion
|
protected Table |
table
|
| Fields inherited from class org.h2.engine.DbObjectBase |
|---|
comment, database, trace |
| Fields inherited from interface org.h2.engine.DbObject |
|---|
AGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE |
| Constructor Summary | |
|---|---|
BaseIndex()
|
|
| Method Summary | |
|---|---|
boolean |
canFindNext()
Check if the index can get the next higher value. |
boolean |
canScan()
Can this index iterate over all rows? |
void |
commit(int operation,
Row row)
Commit the operation for a row. |
int |
compareRows(SearchRow rowData,
SearchRow compare)
Compare two rows. |
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. |
java.lang.String |
getCreateSQL()
Build a SQL statement to re-create this object. |
java.lang.String |
getCreateSQLForCopy(Table targetTable,
java.lang.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 |
java.lang.String |
getDropSQL()
Build a SQL statement to drop this object. |
IndexColumn[] |
getIndexColumns()
Get the indexed columns as index columns (with ordering information). |
IndexType |
getIndexType()
Get the index type. |
java.lang.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,
java.lang.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. |
| Methods inherited from class org.h2.schema.SchemaObjectBase |
|---|
getSchema, getSQL, initSchemaObjectBase |
| Methods inherited from class org.h2.engine.DbObjectBase |
|---|
checkRename, getChildren, getComment, getDatabase, getId, getModificationId, getName, initDbObjectBase, invalidate, isTemporary, rename, setComment, setModified, setObjectName, setTemporary, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.h2.index.Index |
|---|
add, canGetFirstOrLast, close, find, findFirstOrLast, getCost, getRowCount, getRowCountApproximation, needRebuild, remove, remove, truncate |
| Methods inherited from interface org.h2.schema.SchemaObject |
|---|
getSchema |
| Methods inherited from interface org.h2.engine.DbObject |
|---|
checkRename, getChildren, getComment, getDatabase, getId, getName, getSQL, isTemporary, rename, setComment, setTemporary |
| Field Detail |
|---|
protected IndexColumn[] indexColumns
protected Column[] columns
protected int[] columnIds
protected Table table
protected IndexType indexType
protected boolean isMultiVersion
| Constructor Detail |
|---|
public BaseIndex()
| Method Detail |
|---|
protected void initBaseIndex(Table newTable,
int id,
java.lang.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 typepublic java.lang.String getDropSQL()
DbObjectBase
getDropSQL in interface DbObjectgetDropSQL in class DbObjectBasepublic java.lang.String getPlanSQL()
Index
getPlanSQL in interface Indexpublic void removeChildrenAndResources(Session session)
DbObjectBase
removeChildrenAndResources in interface DbObjectremoveChildrenAndResources in class DbObjectBasesession - the sessionpublic boolean canFindNext()
Index
canFindNext in interface Index
public Cursor find(TableFilter filter,
SearchRow first,
SearchRow last)
Index
find in interface Indexfilter - the table filter (which possibly knows
about additional conditions)first - the first row, or null for no limitlast - the last row, or null for no limit
public Cursor findNext(Session session,
SearchRow higherThan,
SearchRow last)
findNext in interface Indexsession - the sessionhigherThan - the lower limit (excluding)last - the last row, or null for no limit
DbException - always
public int compareRows(SearchRow rowData,
SearchRow compare)
Index
compareRows in interface IndexrowData - the first rowcompare - the second row
public int getColumnIndex(Column col)
Index
getColumnIndex in interface Indexcol - the column
public java.lang.String getCreateSQLForCopy(Table targetTable,
java.lang.String quotedName)
DbObject
getCreateSQLForCopy in interface DbObjecttargetTable - the new tablequotedName - the quoted name
public java.lang.String getCreateSQL()
DbObjectBase
getCreateSQL in interface DbObjectgetCreateSQL in class DbObjectBasepublic IndexColumn[] getIndexColumns()
Index
getIndexColumns in interface Indexpublic Column[] getColumns()
Index
getColumns in interface Indexpublic IndexType getIndexType()
Index
getIndexType in interface Indexpublic int getType()
DbObject
getType in interface DbObjectpublic Table getTable()
Index
getTable in interface Index
public void commit(int operation,
Row row)
Index
commit in interface Indexoperation - the operation typerow - the row
public Row getRow(Session session,
long key)
Index
getRow in interface Indexsession - the sessionkey - the unique key
public boolean isHidden()
SchemaObject
isHidden in interface SchemaObjectisHidden in class SchemaObjectBasepublic boolean isRowIdIndex()
Index
isRowIdIndex in interface Indexpublic boolean canScan()
Index
canScan in interface Indexpublic void setSortedInsertMode(boolean sortedInsertMode)
Index
setSortedInsertMode in interface IndexsortedInsertMode - the new value
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||