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

public class CardinalityBasedJoinOrderingWithRequests extends CardinalityBasedJoinOrderingBase
This class is an implementation of CardinalityBasedJoinOrderingBase that uses cardinality requests. That is, this class implements the function
invalid reference
CardinalityBasedJoinOrderingBase#estimateCardinalities(LogicalPlan[] plans)
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,
invalid reference
CardinalityBasedJoinOrderingBase#estimateJoinCardinality(List<AnnotatedLogicalPlan> selectedPlans, int joinCardOfSelectedPlans, AnnotatedLogicalPlan nextCandidate)
, 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.
  • Field Details

  • Constructor Details

    • CardinalityBasedJoinOrderingWithRequests

      public CardinalityBasedJoinOrderingWithRequests(QueryProcContext ctxt)
  • Method Details

    • estimateJoinCardinality

      protected int estimateJoinCardinality(List<LogicalPlan> selectedPlans, int joinCardOfSelectedPlans, LogicalPlan nextCandidate)
      Description copied from class: CardinalityBasedJoinOrderingBase
      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. Implementations that require the individual cardinality estimates for each of the plans can get these estimates by accessing QueryPlan.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:
      estimateJoinCardinality in class CardinalityBasedJoinOrderingBase