|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Index
An index. Indexes are used to speed up searching data.
Field Summary | |
---|---|
static int |
EMPTY_HEAD
Indicates that there is no head record yet. |
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 |
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 |
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 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 |
java.lang.String |
getColumnListSQL()
Get the list of columns as a string. |
Column[] |
getColumns()
Get the indexed columns. |
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.sql.SQLException |
getDuplicateKeyException()
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. |
int |
getLookupCost(long rowCount)
Estimate the cost required to search a number of rows. |
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. |
Table |
getTable()
Get the table on which this index is based. |
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 |
truncate(Session session)
Remove all rows from the index. |
Methods inherited from interface org.h2.schema.SchemaObject |
---|
getSchema |
Methods inherited from interface org.h2.engine.DbObject |
---|
checkRename, getChildren, getComment, getCreateSQL, getCreateSQLForCopy, getDatabase, getDropSQL, getHeadPos, getId, getModificationId, getName, getSQL, getType, isTemporary, removeChildrenAndResources, rename, setComment, setModified, setTemporary |
Field Detail |
---|
static final int EMPTY_HEAD
Method Detail |
---|
java.sql.SQLException getDuplicateKeyException()
java.lang.String getPlanSQL()
void close(Session session) throws java.sql.SQLException
session
- the session used to write data
java.sql.SQLException
void add(Session session, Row row) throws java.sql.SQLException
session
- the session to userow
- the data
java.sql.SQLException
void remove(Session session, Row row) throws java.sql.SQLException
session
- the sessionrow
- the data
java.sql.SQLException
Cursor find(Session session, SearchRow first, SearchRow last) throws java.sql.SQLException
session
- the sessionfirst
- the first row, or null for no limitlast
- the last row, or null for no limit
java.sql.SQLException
double getCost(Session session, int[] masks) throws java.sql.SQLException
session
- the sessionmasks
- the search mask
java.sql.SQLException
void remove(Session session) throws java.sql.SQLException
session
- the session
java.sql.SQLException
void truncate(Session session) throws java.sql.SQLException
session
- the session
java.sql.SQLException
boolean canGetFirstOrLast()
boolean canFindNext()
Cursor findNext(Session session, SearchRow higherThan, SearchRow last) throws java.sql.SQLException
session
- the sessionhigherThan
- the lower limit (excluding)last
- the last row, or null for no limit
java.sql.SQLException
Cursor findFirstOrLast(Session session, boolean first) throws java.sql.SQLException
session
- the sessionfirst
- true if the first (lowest for ascending indexes) or last
value should be returned
java.sql.SQLException
boolean needRebuild()
long getRowCount(Session session)
session
- the session
long getRowCountApproximation()
int getLookupCost(long rowCount)
rowCount
- the row count
long getCostRangeIndex(int[] masks, long rowCount) throws java.sql.SQLException
masks
- the search maskrowCount
- the row count
java.sql.SQLException
int compareRows(SearchRow rowData, SearchRow compare) throws java.sql.SQLException
rowData
- the first rowcompare
- the second row
java.sql.SQLException
boolean containsNullAndAllowMultipleNull(SearchRow newRow)
newRow
- the row to check
int compareKeys(SearchRow rowData, SearchRow compare)
rowData
- the first rowcompare
- the second row
int getColumnIndex(Column col)
col
- the column
java.lang.String getColumnListSQL()
IndexColumn[] getIndexColumns()
Column[] getColumns()
IndexType getIndexType()
Table getTable()
void commit(int operation, Row row) throws java.sql.SQLException
operation
- the operation typerow
- the row
java.sql.SQLException
int getRootPageId()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |