Package org.h2.index
Class DualIndex
java.lang.Object
org.h2.engine.DbObject
org.h2.schema.SchemaObject
org.h2.index.Index
org.h2.index.VirtualTableIndex
org.h2.index.DualIndex
- All Implemented Interfaces:
HasSQL
An index for the DUAL table.
-
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 TypeMethodDescriptionbooleanCheck if the index can directly look up the lowest or highest value of a column.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.findFirstOrLast(SessionLocal session, boolean first) Find the first (or last) value of this index.doublegetCost(SessionLocal session, int[] masks, TableFilter[] filters, int filter, SortOrder sortOrder, AllColumnsForPlan allColumnsSet, boolean isSelectCommand) Estimate the cost to search for rows given the search mask.Construct the CREATE ...Get the message to show in a EXPLAIN statement.Methods inherited from class org.h2.index.VirtualTableIndex
add, checkRename, close, getRowCount, getRowCountApproximation, needRebuild, remove, remove, truncateMethods inherited from class org.h2.index.Index
canFindNext, canScan, checkIndexColumnTypes, compareRows, findNext, getColumnIndex, getColumns, getCostRangeIndex, getCreateSQLForCopy, getDiskSpaceUsed, getDuplicateKeyException, getDuplicatePrimaryKeyMessage, getIndexColumns, getIndexType, getRow, getRowFactory, getTable, getType, getUniqueColumnCount, getUniqueRowFactory, isFindUsingFullTableScan, isFirstColumn, isRowIdIndex, needsUniqueCheck, removeChildrenAndResources, updateMethods inherited from class org.h2.schema.SchemaObject
getSchema, getSQL, getSQLMethods inherited from class org.h2.engine.DbObject
equals, getChildren, getComment, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, hashCode, invalidate, isTemporary, isValid, rename, setComment, setModified, setObjectName, setTemporary, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.h2.util.HasSQL
getTraceSQL
-
Constructor Details
-
DualIndex
-
-
Method Details
-
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, boolean isSelectCommand) 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 columnsisSelectCommand- is this for an SELECT command- Returns:
- the estimated cost
-
getCreateSQL
Description copied from class:DbObjectConstruct the CREATE ... SQL statement for this object.- Overrides:
getCreateSQLin classIndex- Returns:
- the SQL statement
-
canGetFirstOrLast
public boolean canGetFirstOrLast()Description copied from class:IndexCheck if the index can directly look up the lowest or highest value of a column.- Overrides:
canGetFirstOrLastin classIndex- Returns:
- true if it can
-
findFirstOrLast
Description copied from class:IndexFind the first (or last) value of this index. The cursor returned is positioned on the correct row, or on null if no row has been found.- Overrides:
findFirstOrLastin classIndex- Parameters:
session- the sessionfirst- true if the first (lowest for ascending indexes) or last value should be returned- Returns:
- a cursor (never null)
-
getPlanSQL
Description copied from class:IndexGet the message to show in a EXPLAIN statement.- Overrides:
getPlanSQLin classIndex- Returns:
- the plan
-