|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xcmis.search.query.plan.SimplePlaner
public class SimplePlaner
The planner that produces a simple query plan given a query .
A simple plan always has the same structure:
LIMIT if row limit or offset are used
|
SORTING if 'ORDER BY' is used with more then one Source
|
WHERE1
| One or more WHERE plan nodes that each have
WHERE2 a single non-join constraint
|
WHEREn
|
SOURCE or JOIN A single SOURCE or JOIN node, depending upon the query
/ \
/ \
SOJ SOJ A SOURCE or JOIN node for the left and right side of the JOIN
There leaves of the tree are always SOURCE nodes, so conceptually data always flows through this plan from the bottom SOURCE nodes, is adjusted/filtered as it trickles up through the plan, and is then ready to be used by the caller as it emerges from the top node of the plan.
This canonical plan, however, is later optimized and rearranged so that it performs faster.
| Constructor Summary | |
|---|---|
SimplePlaner()
|
|
| Method Summary | |
|---|---|
protected QueryExecutionPlan |
createConstrainPlan(QueryExecutionContext context,
Constraint constraint,
Map<SelectorName,Schema.Table> querySelectorsMap,
QueryExecutionPlan executionPlan)
|
protected QueryExecutionPlan |
createLimits(QueryExecutionContext context,
Limit limit,
QueryExecutionPlan executionPlan)
Attach a LIMIT node at the top of the plan tree. |
QueryExecutionPlan |
createPlan(QueryExecutionContext context,
Query query)
Create a canonical query plan for the given command. |
protected QueryExecutionPlan |
createProject(QueryExecutionContext context,
List<Column> columns,
Map<SelectorName,Schema.Table> selectors,
QueryExecutionPlan executionPlan)
Attach a PROJECT node at the top of the plan tree. |
protected QueryExecutionPlan |
createSelectorPlan(QueryExecutionContext context,
Source source,
Map<SelectorName,Schema.Table> querySelectorsMap)
Populate plan for given selector. |
protected QueryExecutionPlan |
createSorting(QueryExecutionContext context,
List<Ordering> orderings,
QueryExecutionPlan executionPlan)
populate SORT node at top of executionPlan. |
protected void |
separateAndConstraints(Constraint constraint,
List<Constraint> andableConstraints)
Walk the supplied constraint to extract a list of the constraints that can be AND-ed together. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimplePlaner()
| Method Detail |
|---|
public QueryExecutionPlan createPlan(QueryExecutionContext context,
Query query)
QueryExecutionPlaner
createPlan in interface QueryExecutionPlanercontext - the context in which the query is being plannedquery - the query command to be planned
QueryExecutionPlaner.createPlan(org.xcmis.search.query.QueryExecutionContext, org.xcmis.search.model.Query)
protected QueryExecutionPlan createConstrainPlan(QueryExecutionContext context,
Constraint constraint,
Map<SelectorName,Schema.Table> querySelectorsMap,
QueryExecutionPlan executionPlan)
context - constraint - querySelectorsMap - executionPlan -
protected QueryExecutionPlan createSelectorPlan(QueryExecutionContext context,
Source source,
Map<SelectorName,Schema.Table> querySelectorsMap)
throws VisitException
context - source - querySelectorsMap -
VisitException
protected QueryExecutionPlan createSorting(QueryExecutionContext context,
List<Ordering> orderings,
QueryExecutionPlan executionPlan)
context - the context in which the query is being plannedorderings - list of orderings from the queryexecutionPlan - the existing plan
protected QueryExecutionPlan createProject(QueryExecutionContext context,
List<Column> columns,
Map<SelectorName,Schema.Table> selectors,
QueryExecutionPlan executionPlan)
context - the context in which the query is being plannedexecutionPlan - the existing plancolumns - the columns being projected; may be nullselectors - the selectors keyed by their alias or name
protected QueryExecutionPlan createLimits(QueryExecutionContext context,
Limit limit,
QueryExecutionPlan executionPlan)
context - the context in which the query is being plannedlimit - the limit definition; may be nullexecutionPlan - the existing plan *
protected void separateAndConstraints(Constraint constraint,
List<Constraint> andableConstraints)
andConstraints list will contain Constraint objects that all must be true.
constraint - the input constraintandableConstraints - the collection into which all non-AND constraints should be placed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||