Top Description Fields Constructors Methods
org.h2.index

public final Class RegularQueryExpressionIndex

extends QueryExpressionIndex
implements SpatialIndex
Class Inheritance
All Implemented Interfaces
org.h2.index.SpatialIndex
Imports
java.util.ArrayList, org.h2.command.query.AllColumnsForPlan, .Query, org.h2.engine.Constants, .SessionLocal, org.h2.expression.Parameter, org.h2.expression.condition.Comparison, org.h2.result.SearchRow, .SortOrder, org.h2.table.Column, .IndexColumn, .QueryExpressionTable, .TableFilter, org.h2.util.IntArray, org.h2.value.Value

A regular query expression index.

Field Summary

Modifier and TypeField and Description
private final long
evaluatedAt

The time in nanoseconds when this index (and its cost) was calculated.

private final int[]
Inherited from org.h2.index.QueryExpressionIndex:
originalParametersqueryquerySQLtable

Constructor Summary

AccessConstructor and Description
public
RegularQueryExpressionIndex(QueryExpressionTable
the query expression table
table
,
String
the query SQL
querySQL
,
ArrayList<Parameter>
the original parameters
originalParameters
,
SessionLocal
the session
session
,
int[]
the masks
masks
)

Creates a new instance of a regular query expression index.

Method Summary

Modifier and TypeMethod and Description
private Query
addConditions(QueryExpressionTable table, String querySQL, ArrayList<Parameter> originalParameters, SessionLocal session, int[] masks, Query q)

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.

private Cursor
find(SessionLocal session, SearchRow first, SearchRow last, SearchRow intersection)

public Cursor
findByGeometry(SessionLocal
the session
session
,
SearchRow
the lower bound
first
,
SearchRow
the upper bound
last
,
boolean
if true, iterate in reverse (descending) order
reverse
,
SearchRow
the geometry which values should intersect with, or null for anything
intersection
)

Implements org.h2.index.SpatialIndex.findByGeometry.

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 boolean
private static void
setParameter(ArrayList<Parameter> paramList, int x, Value v)

Inherited from org.h2.index.QueryExpressionIndex:
addcheckRenameclosegetPlanSQLgetQuerygetRowCountgetRowCountApproximationneedRebuildremoveremovetruncate

Field Detail

evaluatedAtback to summary
private final long evaluatedAt

The time in nanoseconds when this index (and its cost) was calculated.

indexMasksback to summary
private final int[] indexMasks

Constructor Detail

RegularQueryExpressionIndexback to summary
public RegularQueryExpressionIndex(QueryExpressionTable table, String querySQL, ArrayList<Parameter> originalParameters, SessionLocal session, int[] masks)

Creates a new instance of a regular query expression index.

Parameters
table:QueryExpressionTable

the query expression table

querySQL:String

the query SQL

originalParameters:ArrayList<Parameter>

the original parameters

session:SessionLocal

the session

masks:int[]

the masks

Method Detail

addConditionsback to summary
private Query addConditions(QueryExpressionTable table, String querySQL, ArrayList<Parameter> originalParameters, SessionLocal session, int[] masks, Query q)
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
findback to summary
private Cursor find(SessionLocal session, SearchRow first, SearchRow last, SearchRow intersection)
findByGeometryback to summary
public Cursor findByGeometry(SessionLocal session, SearchRow first, SearchRow last, boolean reverse, SearchRow intersection)

Implements org.h2.index.SpatialIndex.findByGeometry.

Doc from org.h2.index.SpatialIndex.findByGeometry.

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 lower bound

last:SearchRow

the upper bound

reverse:boolean

if true, iterate in reverse (descending) order

intersection:SearchRow

the geometry which values should intersect with, or null for anything

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
isExpiredback to summary
public boolean isExpired()

Implements abstract org.h2.index.QueryExpressionIndex.isExpired.

Annotations
@Override
setParameterback to summary
private static void setParameter(ArrayList<Parameter> paramList, int x, Value v)