Package org.h2.index
Class VirtualTableIndex
- java.lang.Object
-
- org.h2.engine.DbObject
-
- org.h2.schema.SchemaObject
-
- org.h2.index.Index
-
- org.h2.index.VirtualTableIndex
-
- All Implemented Interfaces:
HasSQL
- Direct Known Subclasses:
DualIndex,RangeIndex,VirtualConstructedTableIndex
public abstract class VirtualTableIndex extends Index
An base class for indexes of virtual tables.
-
-
Field Summary
-
Fields inherited from class org.h2.index.Index
columnIds, columns, indexColumns, indexType, table, uniqueColumnColumn
-
Fields inherited from class org.h2.engine.DbObject
AGGREGATE, comment, COMMENT, CONSTANT, CONSTRAINT, database, DOMAIN, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, trace, TRIGGER, USER
-
Fields inherited from interface org.h2.util.HasSQL
ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedVirtualTableIndex(VirtualTable table, java.lang.String name, IndexColumn[] columns)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(SessionLocal session, Row row)Add a row to the index.voidcheckRename()Check if renaming is allowed.voidclose(SessionLocal session)Close this index.longgetRowCount(SessionLocal session)Get the row count of this table, for the given session.longgetRowCountApproximation(SessionLocal session)Get the approximated row count for this table.booleanneedRebuild()Check if the index needs to be rebuilt.voidremove(SessionLocal session)Remove the index.voidremove(SessionLocal session, Row row)Remove a row from the index.voidtruncate(SessionLocal session)Remove all rows from the index.-
Methods inherited from class org.h2.index.Index
canFindNext, canGetFirstOrLast, canScan, checkIndexColumnTypes, compareRows, find, findFirstOrLast, findNext, getColumnIndex, getColumns, getCost, getCostRangeIndex, getCreateSQL, getCreateSQLForCopy, getDiskSpaceUsed, getDuplicateKeyException, getDuplicatePrimaryKeyMessage, getIndexColumns, getIndexType, getPlanSQL, getRow, getRowFactory, getTable, getType, getUniqueColumnCount, getUniqueRowFactory, isFindUsingFullTableScan, isFirstColumn, isHidden, isRowIdIndex, mayHaveNullDuplicates, removeChildrenAndResources, update
-
Methods inherited from class org.h2.schema.SchemaObject
getSchema, getSQL, getSQL
-
Methods inherited from class org.h2.engine.DbObject
getChildren, getComment, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, invalidate, isTemporary, isValid, 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.util.HasSQL
getTraceSQL
-
-
-
-
Constructor Detail
-
VirtualTableIndex
protected VirtualTableIndex(VirtualTable table, java.lang.String name, IndexColumn[] columns)
-
-
Method Detail
-
close
public void close(SessionLocal session)
Description copied from class:IndexClose this index.
-
add
public void add(SessionLocal session, Row row)
Description copied from class:IndexAdd a row to the index.
-
remove
public void remove(SessionLocal session, Row row)
Description copied from class:IndexRemove a row from the index.
-
remove
public void remove(SessionLocal session)
Description copied from class:IndexRemove the index.
-
truncate
public void truncate(SessionLocal session)
Description copied from class:IndexRemove all rows from the index.
-
needRebuild
public boolean needRebuild()
Description copied from class:IndexCheck if the index needs to be rebuilt. This method is called after opening an index.- Specified by:
needRebuildin classIndex- Returns:
- true if a rebuild is required.
-
checkRename
public void checkRename()
Description copied from class:DbObjectCheck if renaming is allowed. Does nothing when allowed.- Overrides:
checkRenamein classDbObject
-
getRowCount
public long getRowCount(SessionLocal session)
Description copied from class:IndexGet the row count of this table, for the given session.- Specified by:
getRowCountin classIndex- Parameters:
session- the session- Returns:
- the row count
-
getRowCountApproximation
public long getRowCountApproximation(SessionLocal session)
Description copied from class:IndexGet the approximated row count for this table.- Specified by:
getRowCountApproximationin classIndex- Parameters:
session- the session- Returns:
- the approximated row count
-
-