|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RelOptPlanner
A RelOptPlanner
is a query optimizer: it transforms a relational
expression into a semantically equivalent relational expression, according to
a given set of rules and a cost model.
Field Summary | |
---|---|
static Logger |
tracer
|
Method Summary | |
---|---|
void |
addListener(RelOptListener newListener)
Adds a listener to this planner. |
boolean |
addRelTraitDef(RelTraitDef relTraitDef)
Registers a rel trait definition. |
boolean |
addRule(RelOptRule rule)
Registers a rule. |
RelNode |
changeTraits(RelNode rel,
RelTraitSet toTraits)
Changes a relational expression to an equivalent one with a different set of traits. |
RelOptPlanner |
chooseDelegate()
Negotiates an appropriate planner to deal with distributed queries. |
RelNode |
ensureRegistered(RelNode rel,
RelNode equivRel)
Registers a relational expression if it is not already registered. |
RelNode |
findBestExp()
Finds the most efficient expression to implement this query. |
RelOptCost |
getCost(RelNode rel)
Computes the cost of a RelNode. |
JavaRelImplementor |
getJavaRelImplementor(RelNode rel)
Retrieves an implementor appropriate for the context in which this planner was created. |
long |
getRelMetadataTimestamp(RelNode rel)
Gets a timestamp for a given rel's metadata. |
RelNode |
getRoot()
Returns the root node of this query. |
boolean |
isRegistered(RelNode rel)
Determines whether a relational expression has been registered. |
RelOptCost |
makeCost(double dRows,
double dCpu,
double dIo)
Creates a cost object. |
RelOptCost |
makeHugeCost()
Creates a cost object representing an enormous non-infinite cost. |
RelOptCost |
makeInfiniteCost()
Creates a cost object representing infinite cost. |
RelOptCost |
makeTinyCost()
Creates a cost object representing a small positive cost. |
RelOptCost |
makeZeroCost()
Creates a cost object representing zero cost. |
RelNode |
register(RelNode rel,
RelNode equivRel)
Registers a relational expression in the expression bank. |
void |
registerMetadataProviders(ChainedRelMetadataProvider chain)
Gives this planner a chance to register one or more RelMetadataProvider s in the chain which will be used to answer metadata
queries. |
void |
registerSchema(RelOptSchema schema)
Tells this planner that a schema exists. |
boolean |
removeRule(RelOptRule rule)
Removes a rule. |
void |
setCancelFlag(CancelFlag cancelFlag)
Installs the cancellation-checking flag for this planner. |
void |
setImportance(RelNode rel,
double importance)
Sets the importance of a relational expression. |
void |
setRoot(RelNode rel)
Sets the root node of this query. |
void |
setRuleDescExclusionFilter(Pattern exclusionFilter)
Sets the exclusion filter to use for this planner. |
Field Detail |
---|
static final Logger tracer
Method Detail |
---|
void setRoot(RelNode rel)
rel
- Relational expressionRelNode getRoot()
boolean addRelTraitDef(RelTraitDef relTraitDef)
RelTraitDef
has already
been registered, does nothing.
Collection.add(E)
boolean addRule(RelOptRule rule)
ConverterRule
and pass the ConverterRule to
all registered
RelTraitDef
instances.
Collection.add(E)
boolean removeRule(RelOptRule rule)
Collection.remove(Object)
void setRuleDescExclusionFilter(Pattern exclusionFilter)
exclusionFilter
- pattern to match for exclusion; null to disable
filteringvoid setCancelFlag(CancelFlag cancelFlag)
cancelFlag
- flag which the planner should periodically checkRelNode changeTraits(RelNode rel, RelTraitSet toTraits)
rel
- Relational expression, may or may not have been registeredtoTraits
- Trait set to convert relational expression to
RelOptPlanner chooseDelegate()
RelNode findBestExp()
RelOptCost makeCost(double dRows, double dCpu, double dIo)
RelOptCost makeHugeCost()
RelOptCost makeInfiniteCost()
RelOptCost makeTinyCost()
RelOptCost makeZeroCost()
RelOptCost getCost(RelNode rel)
RelMetadataQuery.getCumulativeCost(org.eigenbase.rel.RelNode)
.
rel
- expression of interest
RelNode register(RelNode rel, RelNode equivRel)
After it has been registered, you may not modify it.
The expression must not already have been registered. If you are not
sure whether it has been registered, call ensureRegistered(RelNode,RelNode)
.
rel
- Relational expression to register (must not already be
registered)equivRel
- Relational expression it is equivalent to (may be null)
RelNode ensureRegistered(RelNode rel, RelNode equivRel)
rel
- Relational expression to registerequivRel
- Relational expression it is equivalent to (may be null)
boolean isRegistered(RelNode rel)
rel
- expression to test
void registerSchema(RelOptSchema schema)
JavaRelImplementor getJavaRelImplementor(RelNode rel)
void addListener(RelOptListener newListener)
newListener
- new listener to be notified of eventsvoid registerMetadataProviders(ChainedRelMetadataProvider chain)
RelMetadataProvider
s in the chain which will be used to answer metadata
queries. Planners which use their own relational expressions internally
to represent concepts such as equivalence classes will generally need to
supply corresponding metadata providers.
chain
- receives planner's custom providers, if anylong getRelMetadataTimestamp(RelNode rel)
CachingRelMetadataProvider
to decide whether cached metadata has
gone stale.
rel
- rel of interest
void setImportance(RelNode rel, double importance)
An important use of this method is when a RelOptRule
has
created a relational expression which is indisputably better than the
original relational expression. The rule set the original relational
expression's importance to zero, to reduce the search space. Pending rule
calls are cancelled, and future rules will not fire.
rel
- Relational expressionimportance
- Importance
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |