Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-97899

Create EstimatorFactory and refactor query planner to use it

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

      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 Unassigned
            Reporter:
            ben.shteinfeld@mongodb.com Ben Shteinfeld
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: