Create EstimatorFactory and refactor query planner to use it

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      After SERVER-97465, QueryPlanner::planWithCostBasedRanker access histograms via QueryPlannerParams -> CollectionInfo -> CollectionStatistics and the sampling estimator via a parameter to planWithCostBasedRanker. Neither of these are ideal locations for these parameters.

      The tasks for this ticket are:

      • Introduce a interface or class EstimatorFactory which has function to construct a HistogramEstimator, SamplingEstimator and HeuristicEstimator (we will add new estimators here in the future). This may require refactoring histogram CE to be a proper class that interacts with the stats catalog rather than have static functions (we can repurpose CollectionStatistics for this purpose).
      • Refactor QueryPlanner methods to take EstimatorFactory as parameter. Remove SamplingEstimator and CollectionStats arguments.

              Assignee:
              Unassigned
              Reporter:
              Ben Shteinfeld
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: