- 
    Type:
Improvement
 - 
    Resolution: Unresolved
 - 
    Priority:
Minor - P4
 - 
    None
 - 
    Affects Version/s: None
 - 
    Component/s: None
 
- 
        Query Optimization
 - 
        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.
 
- related to
 - 
                    
SERVER-97465 Using sampling to estimate filters
-         
 - Closed
 
 -