Class CardinalityBasedJoinOrderingWithRequests
java.lang.Object
se.liu.ida.hefquin.engine.queryproc.impl.loptimizer.heuristics.CardinalityBasedJoinOrderingBase
se.liu.ida.hefquin.engine.queryproc.impl.loptimizer.heuristics.CardinalityBasedJoinOrderingWithRequests
- All Implemented Interfaces:
HeuristicForLogicalOptimization
This class is an implementation of
by, first, issuing cardinality requests for every request operator within
each of the given plans; then, for each given plan, the cardinalities for
obtained for the corresponding request operators are aggregated. Currently,
this aggregation is just a sum, ignoring whether there are filters or l2g
operators in the plans.
The implementation of the second of the abstract functions of the base class,
,
simply returns the cardinality estimate of the given next candidate subplan.
Hence, when deciding which next candidate subplan to add to the join order,
this implementation greedily picks the candidate with the lowest cardinality
(without considering join cardinalities or anything even more sophisticated).
Subclasses may change this behavior.
The current implementation of this class assumes that all logical plans under
joins (i.e., all plans for which the cardinality needs to be estimated) are
either:
i) a single request,
ii) a filter over a request,
iii) an l2g over a request,
iv) a filter over an l2g over a request,
v) an l2g over a filter over a request,
vi) a union over any of the aforementioned options, or
vii) an l2g over a union over any of the aforementioned (non-union) options.
CardinalityBasedJoinOrderingBase
that uses cardinality requests. That is, this class implements the function
invalid reference
CardinalityBasedJoinOrderingBase#estimateCardinalities(LogicalPlan[] plans)
invalid reference
CardinalityBasedJoinOrderingBase#estimateJoinCardinality(List<AnnotatedLogicalPlan> selectedPlans, int joinCardOfSelectedPlans, AnnotatedLogicalPlan nextCandidate)
-
Field Summary
FieldsFields inherited from class se.liu.ida.hefquin.engine.queryproc.impl.loptimizer.heuristics.CardinalityBasedJoinOrderingBase
cardEst -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intestimateJoinCardinality(List<LogicalPlan> selectedPlans, int joinCardOfSelectedPlans, LogicalPlan nextCandidate) Implementations of this function estimate the cardinality of the join between the result of joining the given selected plans and the result of the given next candidate.Methods inherited from class se.liu.ida.hefquin.engine.queryproc.impl.loptimizer.heuristics.CardinalityBasedJoinOrderingBase
_apply, apply, containsJoinOp, determineIdxOfSmallestCardinality, determineNextPlan, reorder
-
Field Details
-
ctxt
-
-
Constructor Details
-
CardinalityBasedJoinOrderingWithRequests
-
-
Method Details
-
estimateJoinCardinality
protected int estimateJoinCardinality(List<LogicalPlan> selectedPlans, int joinCardOfSelectedPlans, LogicalPlan nextCandidate) Description copied from class:CardinalityBasedJoinOrderingBaseImplementations of this function estimate the cardinality of the join between the result of joining the given selected plans and the result of the given next candidate. Implementations that require the individual cardinality estimates for each of the plans can get these estimates by accessingQueryPlan.getQueryPlanningInfo(). The estimated join cardinality of joining the given selected plans is also passed to this function, in case it is needed by some implementation.- Specified by:
estimateJoinCardinalityin classCardinalityBasedJoinOrderingBase
-