Top Description Fields Constructors Methods
org.h2.index

public Class VirtualConstructedTableIndex

extends VirtualTableIndex
Class Inheritance
Imports
org.h2.command.query.AllColumnsForPlan, org.h2.engine.SessionLocal, org.h2.message.DbException, org.h2.result.SearchRow, .SortOrder, org.h2.table.FunctionTable, .IndexColumn, .TableFilter, .VirtualConstructedTable

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

Modifier and TypeField and Description
private final VirtualConstructedTable

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canScan()

Overrides org.h2.index.Index.canScan.

Can this index iterate over all rows?

public Cursor
find(SessionLocal
the session
session
,
SearchRow
the first row, or null for no limit
first
,
SearchRow
the last row, or null for no limit
last
,
boolean
if true, iterate in reverse (descending) order
reverse
)

Implements abstract org.h2.index.Index.find.

Find a row or a list of rows and create a cursor to iterate over the result.

public double
getCost(SessionLocal
the session
session
,
int[]
per-column comparison bit masks, null means 'always false', see constants in IndexCondition
masks
,
TableFilter[]
all joined table filters
filters
,
int
the current table filter index
filter
,
SortOrder
the sort order
sortOrder
,
AllColumnsForPlan
the set of all columns
allColumnsSet
)

Implements abstract org.h2.index.Index.getCost.

Estimate the cost to search for rows given the search mask.

public String
getPlanSQL()

Overrides org.h2.index.Index.getPlanSQL.

Get the message to show in a EXPLAIN statement.

public boolean
isFindUsingFullTableScan()

Overrides org.h2.index.Index.isFindUsingFullTableScan.

Returns true if find() implementation performs scan over all index, false if find() performs the fast lookup.

Inherited from org.h2.index.VirtualTableIndex:
addcheckRenameclosegetRowCountgetRowCountApproximationneedRebuildremoveremovetruncate

Field Detail

tableback to summary
private final VirtualConstructedTable table

Hides org.h2.index.Index.table.

Constructor Detail

VirtualConstructedTableIndexback to summary
public VirtualConstructedTableIndex(VirtualConstructedTable table, IndexColumn[] columns)

Method Detail

canScanback to summary
public boolean canScan()

Overrides org.h2.index.Index.canScan.

Doc from org.h2.index.Index.canScan.

Can this index iterate over all rows?

Returns:boolean

true if it can

Annotations
@Override
findback to summary
public Cursor find(SessionLocal session, SearchRow first, SearchRow last, boolean reverse)

Implements abstract org.h2.index.Index.find.

Doc from org.h2.index.Index.find.

Find a row or a list of rows and create a cursor to iterate over the result.

Parameters
session:SessionLocal

the session

first:SearchRow

the first row, or null for no limit

last:SearchRow

the last row, or null for no limit

reverse:boolean

if true, iterate in reverse (descending) order

Returns:Cursor

the cursor to iterate over the results

Annotations
@Override
getCostback to summary
public double getCost(SessionLocal session, int[] masks, TableFilter[] filters, int filter, SortOrder sortOrder, AllColumnsForPlan allColumnsSet)

Implements abstract org.h2.index.Index.getCost.

Doc from org.h2.index.Index.getCost.

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.

Parameters
session:SessionLocal

the session

masks:int[]

per-column comparison bit masks, null means 'always false', see constants in IndexCondition

filters:TableFilter[]

all joined table filters

filter:int

the current table filter index

sortOrder:SortOrder

the sort order

allColumnsSet:AllColumnsForPlan

the set of all columns

Returns:double

the estimated cost

Annotations
@Override
getPlanSQLback to summary
public String getPlanSQL()

Overrides org.h2.index.Index.getPlanSQL.

Doc from org.h2.index.Index.getPlanSQL.

Get the message to show in a EXPLAIN statement.

Returns:String

the plan

Annotations
@Override
isFindUsingFullTableScanback to summary
public boolean isFindUsingFullTableScan()

Overrides org.h2.index.Index.isFindUsingFullTableScan.

Doc from org.h2.index.Index.isFindUsingFullTableScan.

Returns true if find() implementation performs scan over all index, false if find() performs the fast lookup.

Returns:boolean

true if find() implementation performs scan over all index, false if find() performs the fast lookup

Annotations
@Override