org.h2.index
Class NonUniqueHashIndex
java.lang.Object
org.h2.engine.DbObjectBase
org.h2.schema.SchemaObjectBase
org.h2.index.BaseIndex
org.h2.index.HashIndex
org.h2.index.NonUniqueHashIndex
- All Implemented Interfaces:
- DbObject, Index, SchemaObject
public class NonUniqueHashIndex
- extends HashIndex
A non-unique index based on an in-memory hash map.
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 |
Methods inherited from class org.h2.index.BaseIndex |
canFindNext, commit, compareRows, containsNullAndAllowMultipleNull, find, findNext, getColumnIndex, getColumns, getCostRangeIndex, getCreateSQL, getCreateSQLForCopy, getDropSQL, getDuplicateKeyException, getIndexColumns, getIndexType, getPlanSQL, getRow, getTable, getType, initBaseIndex, isHidden, isRowIdIndex, removeChildrenAndResources, setSortedInsertMode |
Methods inherited from class org.h2.engine.DbObjectBase |
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 |
NonUniqueHashIndex
public NonUniqueHashIndex(RegularTable table,
int id,
java.lang.String indexName,
IndexColumn[] columns,
IndexType indexType)
truncate
public void truncate(Session session)
- Description copied from interface:
Index
- Remove all rows from the index.
- Specified by:
truncate
in interface Index
- Overrides:
truncate
in class HashIndex
- Parameters:
session
- the session
add
public void add(Session session,
Row row)
- Description copied from interface:
Index
- Add a row to the index.
- Specified by:
add
in interface Index
- Overrides:
add
in class HashIndex
- Parameters:
session
- the session to userow
- the row to add
remove
public void remove(Session session,
Row row)
- Description copied from interface:
Index
- Remove a row from the index.
- Specified by:
remove
in interface Index
- Overrides:
remove
in class HashIndex
- Parameters:
session
- the sessionrow
- the row
find
public Cursor find(Session session,
SearchRow first,
SearchRow last)
- Description copied from interface:
Index
- Find a row or a list of rows and create a cursor to iterate over the result.
- Specified by:
find
in interface Index
- Overrides:
find
in class HashIndex
- Parameters:
session
- the sessionfirst
- the first row, or null for no limitlast
- the last row, or null for no limit
- Returns:
- the cursor to iterate over the results
getRowCount
public long getRowCount(Session session)
- Description copied from interface:
Index
- Get the row count of this table, for the given session.
- Specified by:
getRowCount
in interface Index
- Overrides:
getRowCount
in class HashIndex
- Parameters:
session
- the session
- Returns:
- the row count
getRowCountApproximation
public long getRowCountApproximation()
- Description copied from interface:
Index
- Get the approximated row count for this table.
- Specified by:
getRowCountApproximation
in interface Index
- Overrides:
getRowCountApproximation
in class HashIndex
- Returns:
- the approximated row count