Package org.h2.table
Class Plan
- java.lang.Object
-
- org.h2.table.Plan
-
public class Plan extends java.lang.Object
A possible query execution plan. The time required to execute a query depends on the order the tables are accessed.
-
-
Field Summary
Fields Modifier and Type Field Description private Expression[]
allConditions
private TableFilter[]
allFilters
private TableFilter[]
filters
private java.util.HashMap<TableFilter,PlanItem>
planItems
-
Constructor Summary
Constructors Constructor Description Plan(TableFilter[] filters, int count, Expression condition)
Create a query plan with the given order.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
calculateCost(SessionLocal session, AllColumnsForPlan allColumnsSet)
Calculate the cost of this query plan.TableFilter[]
getFilters()
The the list of tables.PlanItem
getItem(TableFilter filter)
Get the plan item for the given table.void
removeUnusableIndexConditions()
Remove all index conditions that can not be used.private void
setEvaluatable(TableFilter filter, boolean b)
-
-
-
Field Detail
-
filters
private final TableFilter[] filters
-
planItems
private final java.util.HashMap<TableFilter,PlanItem> planItems
-
allConditions
private final Expression[] allConditions
-
allFilters
private final TableFilter[] allFilters
-
-
Constructor Detail
-
Plan
public Plan(TableFilter[] filters, int count, Expression condition)
Create a query plan with the given order.- Parameters:
filters
- the tables of the querycount
- the number of table itemscondition
- the condition in the WHERE clause
-
-
Method Detail
-
getItem
public PlanItem getItem(TableFilter filter)
Get the plan item for the given table.- Parameters:
filter
- the table- Returns:
- the plan item
-
getFilters
public TableFilter[] getFilters()
The the list of tables.- Returns:
- the list of tables
-
removeUnusableIndexConditions
public void removeUnusableIndexConditions()
Remove all index conditions that can not be used.
-
calculateCost
public double calculateCost(SessionLocal session, AllColumnsForPlan allColumnsSet)
Calculate the cost of this query plan.- Parameters:
session
- the sessionallColumnsSet
- calculates all columns on-demand- Returns:
- the cost
-
setEvaluatable
private void setEvaluatable(TableFilter filter, boolean b)
-
-