Package org.h2.index
Class VirtualConstructedTableIndex
- java.lang.Object
-
- org.h2.engine.DbObject
-
- org.h2.schema.SchemaObject
-
- org.h2.index.Index
-
- org.h2.index.VirtualTableIndex
-
- org.h2.index.VirtualConstructedTableIndex
-
- All Implemented Interfaces:
HasSQL
public class VirtualConstructedTableIndex extends VirtualTableIndex
An index for a virtual table that returns a result set. Search in this index performs scan over all rows and should be avoided.
-
-
Field Summary
Fields Modifier and Type Field Description private VirtualConstructedTable
table
-
Fields inherited from class org.h2.index.Index
columnIds, columns, indexColumns, indexType, 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 Constructor Description VirtualConstructedTableIndex(VirtualConstructedTable table, IndexColumn[] columns)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canScan()
Can this index iterate over all rows?Cursor
find(SessionLocal session, SearchRow first, SearchRow last)
Find a row or a list of rows and create a cursor to iterate over the result.double
getCost(SessionLocal session, int[] masks, TableFilter[] filters, int filter, SortOrder sortOrder, AllColumnsForPlan allColumnsSet)
Estimate the cost to search for rows given the search mask.java.lang.String
getPlanSQL()
Get the message to show in a EXPLAIN statement.boolean
isFindUsingFullTableScan()
Returnstrue
iffind()
implementation performs scan over all index,false
iffind()
performs the fast lookup.-
Methods inherited from class org.h2.index.VirtualTableIndex
add, checkRename, close, getRowCount, getRowCountApproximation, needRebuild, remove, remove, truncate
-
Methods inherited from class org.h2.index.Index
canFindNext, canGetFirstOrLast, checkIndexColumnTypes, compareRows, findFirstOrLast, findNext, getColumnIndex, getColumns, getCostRangeIndex, getCreateSQL, getCreateSQLForCopy, getDiskSpaceUsed, getDuplicateKeyException, getDuplicatePrimaryKeyMessage, getIndexColumns, getIndexType, getRow, getRowFactory, getTable, getType, getUniqueColumnCount, getUniqueRowFactory, 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
-
-
-
-
Field Detail
-
table
private final VirtualConstructedTable table
-
-
Constructor Detail
-
VirtualConstructedTableIndex
public VirtualConstructedTableIndex(VirtualConstructedTable table, IndexColumn[] columns)
-
-
Method Detail
-
isFindUsingFullTableScan
public boolean isFindUsingFullTableScan()
Description copied from class:Index
Returnstrue
iffind()
implementation performs scan over all index,false
iffind()
performs the fast lookup.- Overrides:
isFindUsingFullTableScan
in classIndex
- Returns:
true
iffind()
implementation performs scan over all index,false
iffind()
performs the fast lookup
-
find
public Cursor find(SessionLocal session, SearchRow first, SearchRow last)
Description copied from class:Index
Find 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:Index
Estimate 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:
getCost
in 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
-
getPlanSQL
public java.lang.String getPlanSQL()
Description copied from class:Index
Get the message to show in a EXPLAIN statement.- Overrides:
getPlanSQL
in classIndex
- Returns:
- the plan
-
-