|
||||||||||
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.index.Index |
---|
EMPTY_HEAD |
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,
TableData 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. |
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 |
compareKeys(SearchRow rowData,
SearchRow compare)
Compare the positions of two rows. |
int |
compareRows(SearchRow rowData,
SearchRow compare)
Compare two rows. |
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. |
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 |
findFirstOrLast(Session session,
boolean first)
Find the lowest or highest value of a column. |
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. |
ObjectArray<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 |
java.lang.String |
getColumnListSQL()
Get the list of columns as a string. |
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. |
long |
getCostRangeIndex(int[] masks,
long rowCount)
Estimate the cost required to search one row, and then iterate over the given number of rows. |
java.lang.String |
getCreateSQL()
Construct the original CREATE ... |
java.lang.String |
getCreateSQLForCopy(Table forTable,
java.lang.String quotedName)
Construct a CREATE ... |
Database |
getDatabase()
Get the database. |
java.lang.String |
getDropSQL()
Construct a DROP ... |
java.sql.SQLException |
getDuplicateKeyException()
Create a duplicate key exception with a message that contains the index name |
int |
getHeadPos()
Get the position of the head record. |
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. |
int |
getLookupCost(long rowCount)
Estimate the cost required to search a number of rows. |
long |
getModificationId()
Get the last modification id. |
java.lang.String |
getName()
Get the name. |
java.lang.String |
getPlanSQL()
Get the message to show in a EXPLAIN statement. |
int |
getRootPageId()
Get the root page of this index. |
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 |
isTemporary()
Check if this object is temporary (for example, a temporary table). |
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 |
setModified()
Tell the object that is was modified. |
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, TableData table)
Method Detail |
---|
public void add(Session session, Row row) throws java.sql.SQLException
Index
add
in interface Index
session
- the session to userow
- the data
java.sql.SQLException
public int getRootPageId()
Index
getRootPageId
in interface Index
public void close(Session session) throws java.sql.SQLException
Index
close
in interface Index
session
- the session used to write data
java.sql.SQLException
public Cursor find(Session session, SearchRow first, SearchRow last) throws java.sql.SQLException
Index
find
in interface Index
session
- the sessionfirst
- the first row, or null for no limitlast
- the last row, or null for no limit
java.sql.SQLException
public Cursor findNext(Session session, SearchRow first, SearchRow last)
Index
findNext
in interface Index
session
- the sessionfirst
- the lower limit (excluding)last
- the last row, or null for no limit
public boolean canFindNext()
Index
canFindNext
in interface Index
public boolean canGetFirstOrLast()
Index
canGetFirstOrLast
in interface Index
public Cursor findFirstOrLast(Session session, boolean first) throws java.sql.SQLException
Index
findFirstOrLast
in interface Index
session
- the sessionfirst
- true if the first (lowest for ascending indexes) or last
value should be returned
java.sql.SQLException
public double getCost(Session session, int[] masks) throws java.sql.SQLException
Index
getCost
in interface Index
session
- the sessionmasks
- the search mask
java.sql.SQLException
public boolean needRebuild()
Index
needRebuild
in interface Index
public void remove(Session session, Row row) throws java.sql.SQLException
Index
remove
in interface Index
session
- the sessionrow
- the data
java.sql.SQLException
public void remove(Session session) throws java.sql.SQLException
Index
remove
in interface Index
session
- the session
java.sql.SQLException
public void truncate(Session session) throws java.sql.SQLException
Index
truncate
in interface Index
session
- the session
java.sql.SQLException
public void commit(int operation, Row row) throws java.sql.SQLException
Index
commit
in interface Index
operation
- the operation typerow
- the row
java.sql.SQLException
public int compareKeys(SearchRow rowData, SearchRow compare)
Index
compareKeys
in interface Index
rowData
- the first rowcompare
- the second row
public int compareRows(SearchRow rowData, SearchRow compare) throws java.sql.SQLException
Index
compareRows
in interface Index
rowData
- the first rowcompare
- the second row
java.sql.SQLException
public int getColumnIndex(Column col)
Index
getColumnIndex
in interface Index
col
- the column
public java.lang.String getColumnListSQL()
Index
getColumnListSQL
in interface Index
public Column[] getColumns()
Index
getColumns
in interface Index
public IndexColumn[] getIndexColumns()
Index
getIndexColumns
in interface Index
public long getCostRangeIndex(int[] masks, long rowCount) throws java.sql.SQLException
Index
getCostRangeIndex
in interface Index
masks
- the search maskrowCount
- the row count
java.sql.SQLException
public java.lang.String getCreateSQL()
DbObject
getCreateSQL
in interface DbObject
public java.lang.String getCreateSQLForCopy(Table forTable, java.lang.String quotedName)
DbObject
getCreateSQLForCopy
in interface DbObject
forTable
- the new tablequotedName
- the quoted name
public java.lang.String getDropSQL()
DbObject
getDropSQL
in interface DbObject
public java.sql.SQLException getDuplicateKeyException()
Index
getDuplicateKeyException
in interface Index
public IndexType getIndexType()
Index
getIndexType
in interface Index
public int getLookupCost(long rowCount)
Index
getLookupCost
in interface Index
rowCount
- the row count
public java.lang.String getPlanSQL()
Index
getPlanSQL
in interface Index
public long getRowCount(Session session)
Index
getRowCount
in interface Index
session
- the session
public Table getTable()
Index
getTable
in interface Index
public int getType()
DbObject
getType
in interface DbObject
public boolean containsNullAndAllowMultipleNull(SearchRow newRow)
Index
containsNullAndAllowMultipleNull
in interface Index
newRow
- the row to check
public void removeChildrenAndResources(Session session) throws java.sql.SQLException
DbObject
removeChildrenAndResources
in interface DbObject
session
- the session
java.sql.SQLException
public java.lang.String getSQL()
DbObject
getSQL
in interface DbObject
public Schema getSchema()
SchemaObject
getSchema
in interface SchemaObject
public void checkRename() throws java.sql.SQLException
DbObject
checkRename
in interface DbObject
java.sql.SQLException
- if renaming is not allowedpublic ObjectArray<DbObject> getChildren()
DbObject
getChildren
in interface DbObject
public java.lang.String getComment()
DbObject
getComment
in interface DbObject
public Database getDatabase()
DbObject
getDatabase
in interface DbObject
public int getHeadPos()
DbObject
getHeadPos
in interface DbObject
public int getId()
DbObject
getId
in interface DbObject
public long getModificationId()
DbObject
getModificationId
in interface DbObject
public java.lang.String getName()
DbObject
getName
in interface DbObject
public boolean isTemporary()
DbObject
isTemporary
in interface DbObject
public void rename(java.lang.String newName) throws java.sql.SQLException
DbObject
rename
in interface DbObject
newName
- the new name
java.sql.SQLException
public void setComment(java.lang.String comment)
DbObject
setComment
in interface DbObject
comment
- the new comment, or null for no commentpublic void setModified()
DbObject
setModified
in interface DbObject
public void setTemporary(boolean temporary)
DbObject
setTemporary
in interface DbObject
temporary
- the new valuepublic long getRowCountApproximation()
Index
getRowCountApproximation
in interface Index
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |