Top Description Fields Constructors Methods
org.h2.table

public Class Plan

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Arrays, .HashMap, org.h2.command.query.AllColumnsForPlan, org.h2.engine.SessionLocal, org.h2.expression.Expression, .ExpressionVisitor, org.h2.message.Trace

A possible query execution plan. The time required to execute a query depends on the order the tables are accessed.

Field Summary

Modifier and TypeField and Description
private final Expression[]
private final TableFilter[]
private final TableFilter[]
private final HashMap<TableFilter, PlanItem>

Constructor Summary

AccessConstructor and Description
public
Plan(TableFilter[]
the tables of the query
filters
,
int
the number of table items
count
,
Expression
the condition in the WHERE clause
condition
)

Create a query plan with the given order.

Method Summary

Modifier and TypeMethod and Description
public double

Returns:

the cost
calculateCost
(SessionLocal
the session
session
,
AllColumnsForPlan
calculates all columns on-demand
allColumnsSet
)

Calculate the cost of this query plan.

public TableFilter[]

Returns:

the list of tables
getFilters
()

The the list of tables.

public PlanItem

Returns:

the plan item
getItem
(TableFilter
the table
filter
)

Get the plan item for the given table.

public void
removeUnusableIndexConditions()

Remove all index conditions that can not be used.

private void
setEvaluatable(TableFilter filter, boolean b)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allConditionsback to summary
private final Expression[] allConditions
allFiltersback to summary
private final TableFilter[] allFilters
filtersback to summary
private final TableFilter[] filters
planItemsback to summary
private final HashMap<TableFilter, PlanItem> planItems

Constructor Detail

Planback to summary
public Plan(TableFilter[] filters, int count, Expression condition)

Create a query plan with the given order.

Parameters
filters:TableFilter[]

the tables of the query

count:int

the number of table items

condition:Expression

the condition in the WHERE clause

Method Detail

calculateCostback to summary
public double calculateCost(SessionLocal session, AllColumnsForPlan allColumnsSet)

Calculate the cost of this query plan.

Parameters
session:SessionLocal

the session

allColumnsSet:AllColumnsForPlan

calculates all columns on-demand

Returns:double

the cost

getFiltersback to summary
public TableFilter[] getFilters()

The the list of tables.

Returns:TableFilter[]

the list of tables

getItemback to summary
public PlanItem getItem(TableFilter filter)

Get the plan item for the given table.

Parameters
filter:TableFilter

the table

Returns:PlanItem

the plan item

removeUnusableIndexConditionsback to summary
public void removeUnusableIndexConditions()

Remove all index conditions that can not be used.

setEvaluatableback to summary
private void setEvaluatable(TableFilter filter, boolean b)