|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.h2.index.MultiVersionIndex
public class MultiVersionIndex
A multi-version index is a combination of a regular index, and a in-memory tree index that contains uncommitted changes. Uncommitted changes can include new rows, and deleted rows.
| Field Summary |
|---|
| 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 | |
|---|---|
MultiVersionIndex(Index base,
RegularTable table)
|
|
| Method Summary | |
|---|---|
void |
add(Session session,
Row row)
Add a row to the index. |
boolean |
canFindNext()
Check if the index can get the next higher value. |
boolean |
canGetFirstOrLast()
Check if the index can directly look up the lowest or highest value of a column. |
boolean |
canScan()
Can this index iterate over all rows? |
void |
checkRename()
Check if renaming is allowed. |
void |
close(Session session)
Close this index. |
void |
commit(int operation,
Row row)
Commit the operation for a row. |
int |
compareRows(SearchRow rowData,
SearchRow compare)
Compare two rows. |
Cursor |
find(Session session,
SearchRow first,
SearchRow last)
Find a row or a list of rows and create a cursor to iterate over the result. |
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 |
findFirstOrLast(Session session,
boolean first)
Find the first (or last) value of this index. |
Cursor |
findNext(Session session,
SearchRow first,
SearchRow last)
Find a row or a list of rows that is larger and create a cursor to iterate over the result. |
Index |
getBaseIndex()
|
java.util.ArrayList<DbObject> |
getChildren()
Get the list of dependent children (for tables, this includes indexes and so on). |
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 |
getComment()
Get the current comment of this object. |
double |
getCost(Session session,
int[] masks)
Estimate the cost to search for rows given the search mask. |
java.lang.String |
getCreateSQL()
Construct the original CREATE ... |
java.lang.String |
getCreateSQLForCopy(Table forTable,
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 |
Database |
getDatabase()
Get the database. |
java.lang.String |
getDropSQL()
Construct a DROP ... |
int |
getId()
Get the unique object id. |
IndexColumn[] |
getIndexColumns()
Get the indexed columns as index columns (with ordering information). |
IndexType |
getIndexType()
Get the index type. |
java.lang.String |
getName()
Get the name. |
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. |
long |
getRowCount(Session session)
Get the row count of this table, for the given session. |
long |
getRowCountApproximation()
Get the approximated row count for this table. |
Schema |
getSchema()
Get the schema in which this object is defined |
java.lang.String |
getSQL()
Get the SQL name of this object (may be quoted). |
Table |
getTable()
Get the table on which this index is based. |
int |
getType()
Get the object type. |
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? |
boolean |
isTemporary()
Check if this object is temporary (for example, a temporary table). |
boolean |
isUncommittedFromOtherSession(Session session,
Row row)
Check if there is an uncommitted row with the given key within a different session. |
boolean |
needRebuild()
Check if the index needs to be rebuilt. |
void |
remove(Session session)
Remove the index. |
void |
remove(Session session,
Row row)
Remove a row from the index. |
void |
removeChildrenAndResources(Session session)
Delete all dependent children objects and resources of this object. |
void |
rename(java.lang.String newName)
Rename the object. |
void |
setComment(java.lang.String comment)
Change the comment 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. |
void |
setTemporary(boolean temporary)
Tell this object that it is temporary or not. |
void |
truncate(Session session)
Remove all rows from the index. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultiVersionIndex(Index base,
RegularTable table)
| Method Detail |
|---|
public void add(Session session,
Row row)
Index
add in interface Indexsession - the session to userow - the row to addpublic void close(Session session)
Index
close in interface Indexsession - the session used to write data
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 find(Session session,
SearchRow first,
SearchRow last)
Index
find in interface Indexsession - the sessionfirst - the first row, or null for no limitlast - the last row, or null for no limit
public Cursor findNext(Session session,
SearchRow first,
SearchRow last)
Index
findNext in interface Indexsession - the sessionfirst - the lower limit (excluding)last - the last row, or null for no limit
public boolean canFindNext()
Index
canFindNext in interface Indexpublic boolean canGetFirstOrLast()
Index
canGetFirstOrLast in interface Index
public Cursor findFirstOrLast(Session session,
boolean first)
Index
findFirstOrLast in interface Indexsession - the sessionfirst - true if the first (lowest for ascending indexes) or last
value should be returned
public double getCost(Session session,
int[] masks)
Index
getCost in interface Indexsession - the sessionmasks - the search mask
public boolean needRebuild()
Index
needRebuild in interface Index
public boolean isUncommittedFromOtherSession(Session session,
Row row)
session - the original sessionrow - the row (only the key is checked)
public void remove(Session session,
Row row)
Index
remove in interface Indexsession - the sessionrow - the rowpublic void remove(Session session)
Index
remove in interface Indexsession - the sessionpublic void truncate(Session session)
Index
truncate in interface Indexsession - the session
public void commit(int operation,
Row row)
Index
commit in interface Indexoperation - the operation typerow - the row
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 Column[] getColumns()
Index
getColumns in interface Indexpublic IndexColumn[] getIndexColumns()
Index
getIndexColumns in interface Indexpublic java.lang.String getCreateSQL()
DbObject
getCreateSQL in interface DbObject
public java.lang.String getCreateSQLForCopy(Table forTable,
java.lang.String quotedName)
DbObject
getCreateSQLForCopy in interface DbObjectforTable - the new tablequotedName - the quoted name
public java.lang.String getDropSQL()
DbObject
getDropSQL in interface DbObjectpublic IndexType getIndexType()
Index
getIndexType in interface Indexpublic java.lang.String getPlanSQL()
Index
getPlanSQL in interface Indexpublic long getRowCount(Session session)
Index
getRowCount in interface Indexsession - the session
public Table getTable()
Index
getTable in interface Indexpublic int getType()
DbObject
getType in interface DbObjectpublic void removeChildrenAndResources(Session session)
DbObject
removeChildrenAndResources in interface DbObjectsession - the sessionpublic java.lang.String getSQL()
DbObject
getSQL in interface DbObjectpublic Schema getSchema()
SchemaObject
getSchema in interface SchemaObjectpublic void checkRename()
DbObject
checkRename in interface DbObjectpublic java.util.ArrayList<DbObject> getChildren()
DbObject
getChildren in interface DbObjectpublic java.lang.String getComment()
DbObject
getComment in interface DbObjectpublic Database getDatabase()
DbObject
getDatabase in interface DbObjectpublic int getId()
DbObject
getId in interface DbObjectpublic java.lang.String getName()
DbObject
getName in interface DbObjectpublic boolean isTemporary()
DbObject
isTemporary in interface DbObjectpublic void rename(java.lang.String newName)
DbObject
rename in interface DbObjectnewName - the new namepublic void setComment(java.lang.String comment)
DbObject
setComment in interface DbObjectcomment - the new comment, or null for no commentpublic void setTemporary(boolean temporary)
DbObject
setTemporary in interface DbObjecttemporary - the new valuepublic long getRowCountApproximation()
Index
getRowCountApproximation in interface Indexpublic Index getBaseIndex()
public Row getRow(Session session,
long key)
Index
getRow in interface Indexsession - the sessionkey - the unique key
public boolean isHidden()
SchemaObject
isHidden in interface SchemaObjectpublic 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 | |||||||