Package org.h2.index
Class MetaIndex
java.lang.Object
org.h2.engine.DbObject
org.h2.schema.SchemaObject
org.h2.index.Index
org.h2.index.MetaIndex
- All Implemented Interfaces:
HasSQL
The index implementation for meta data tables.
-
Field Summary
Fields inherited from class org.h2.index.Index
columnIds, columns, indexColumns, indexType, table, uniqueColumnColumnFields 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, USERFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(SessionLocal session, Row row) Add a row to the index.voidCheck if renaming is allowed.voidclose(SessionLocal session) Close this index.find(SessionLocal session, SearchRow first, SearchRow last, boolean reverse) Find a row or a list of rows and create a cursor to iterate over the result.intgetColumnIndex(Column col) Get the index of a column in the list of index columnsdoublegetCost(SessionLocal session, int[] masks, TableFilter[] filters, int filter, SortOrder sortOrder, AllColumnsForPlan allColumnsSet) Estimate the cost to search for rows given the search mask.Construct the CREATE ...longgetDiskSpaceUsed(boolean approximate) Get the used disk space for this index.Get the message to show in a EXPLAIN statement.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.booleanisFirstColumn(Column column) Check if the given column is the first for this indexbooleanCheck 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, findFirstOrLast, findNext, getColumns, getCostRangeIndex, getCreateSQLForCopy, getDuplicateKeyException, getDuplicatePrimaryKeyMessage, getIndexColumns, getIndexType, getRow, getRowFactory, getTable, getType, getUniqueColumnCount, getUniqueRowFactory, isFindUsingFullTableScan, isRowIdIndex, needsUniqueCheck, removeChildrenAndResources, updateMethods inherited from class org.h2.schema.SchemaObject
getSchema, getSQL, getSQLMethods inherited from class org.h2.engine.DbObject
getChildren, getComment, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, invalidate, isTemporary, isValid, rename, setComment, setModified, setObjectName, setTemporary, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.h2.util.HasSQL
getTraceSQL
-
Constructor Details
-
MetaIndex
-
-
Method Details
-
close
Description copied from class:IndexClose this index. -
add
Description copied from class:IndexAdd a row to the index. -
remove
Description copied from class:IndexRemove a row from the index. -
find
Description copied from class:IndexFind a row or a list of rows and create a cursor to iterate over the result. -
getCost
public double getCost(SessionLocal session, int[] masks, TableFilter[] filters, int filter, SortOrder sortOrder, AllColumnsForPlan allColumnsSet) Description copied from class:IndexEstimate the cost to search for rows given the search mask. There is one element per column in the search mask. For possible search masks, see IndexCondition.- Specified by:
getCostin classIndex- Parameters:
session- the sessionmasks- per-column comparison bit masks, null means 'always false', see constants in IndexConditionfilters- all joined table filtersfilter- the current table filter indexsortOrder- the sort orderallColumnsSet- the set of all columns- Returns:
- the estimated cost
-
truncate
Description copied from class:IndexRemove all rows from the index. -
remove
Description copied from class:IndexRemove the index. -
getColumnIndex
Description copied from class:IndexGet the index of a column in the list of index columns- Overrides:
getColumnIndexin classIndex- Parameters:
col- the column- Returns:
- the index (0 meaning first column)
-
isFirstColumn
Description copied from class:IndexCheck if the given column is the first for this index- Overrides:
isFirstColumnin classIndex- Parameters:
column- the column- Returns:
- true if the given columns is the first
-
checkRename
public void checkRename()Description copied from class:DbObjectCheck if renaming is allowed. Does nothing when allowed.- Overrides:
checkRenamein classDbObject
-
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.
-
getCreateSQL
Description copied from class:DbObjectConstruct the CREATE ... SQL statement for this object.- Overrides:
getCreateSQLin classIndex- Returns:
- the SQL statement
-
getRowCount
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
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
-
getDiskSpaceUsed
public long getDiskSpaceUsed(boolean approximate) Description copied from class:IndexGet the used disk space for this index.- Overrides:
getDiskSpaceUsedin classIndex- Parameters:
approximate-trueto return quick approximation- Returns:
- the estimated number of bytes
-
getPlanSQL
Description copied from class:IndexGet the message to show in a EXPLAIN statement.- Overrides:
getPlanSQLin classIndex- Returns:
- the plan
-