Top Description Fields Constructors Methods
org.h2.index

public Class RangeIndex

extends VirtualTableIndex
Class Inheritance
Imports
org.h2.api.ErrorCode, org.h2.command.query.AllColumnsForPlan, org.h2.engine.SessionLocal, org.h2.message.DbException, org.h2.result.Row, .SearchRow, .SortOrder, org.h2.table.IndexColumn, .RangeTable, .TableFilter, org.h2.value.Value, .ValueBigint

An index for the SYSTEM_RANGE table. This index can only scan through all rows, search is not supported.

Field Summary

Modifier and TypeField and Description
private final RangeTable

Constructor Summary

AccessConstructor and Description
public
RangeIndex(RangeTable table, IndexColumn[] columns)

Method Summary

Modifier and TypeMethod and Description
public boolean
canGetFirstOrLast()

Overrides org.h2.index.Index.canGetFirstOrLast.

Check if the index can directly look up the lowest or highest value of a column.

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 Cursor
findFirstOrLast(SessionLocal
the session
session
,
boolean
true if the first (lowest for ascending indexes) or last value should be returned
first
)

Overrides org.h2.index.Index.findFirstOrLast.

Find the first (or last) value of this index.

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
getCreateSQL()

Overrides org.h2.index.Index.getCreateSQL.

Construct the CREATE ...

public String
getPlanSQL()

Overrides org.h2.index.Index.getPlanSQL.

Get the message to show in a EXPLAIN statement.

Inherited from org.h2.index.VirtualTableIndex:
addcheckRenameclosegetRowCountgetRowCountApproximationneedRebuildremoveremovetruncate

Field Detail

rangeTableback to summary
private final RangeTable rangeTable

Constructor Detail

RangeIndexback to summary
public RangeIndex(RangeTable table, IndexColumn[] columns)

Method Detail

canGetFirstOrLastback to summary
public boolean canGetFirstOrLast()

Overrides org.h2.index.Index.canGetFirstOrLast.

Doc from org.h2.index.Index.canGetFirstOrLast.

Check if the index can directly look up the lowest or highest value of a column.

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
findFirstOrLastback to summary
public Cursor findFirstOrLast(SessionLocal session, boolean first)

Overrides org.h2.index.Index.findFirstOrLast.

Doc from org.h2.index.Index.findFirstOrLast.

Find 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.

Parameters
session:SessionLocal

the session

first:boolean

true if the first (lowest for ascending indexes) or last value should be returned

Returns:Cursor

a cursor (never null)

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
getCreateSQLback to summary
public String getCreateSQL()

Overrides org.h2.index.Index.getCreateSQL.

Doc from org.h2.engine.DbObject.getCreateSQL.

Construct the CREATE ... SQL statement for this object.

Returns:String

the SQL statement

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