Consolidate PlanExplainerSBEBase into PlanExplainerClassicRuntimePlannerForSBE

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

      PlanExplainerSBEBase was introduced by SERVER-85240 (a882cdaa0e6) to share SBE-tree logic between two subclasses: PlanExplainerSBE (for the SBE runtime planners) and PlanExplainerClassicRuntimePlannerForSBE.

      SERVER-93684 (0b750be4288) removed PlanExplainerSBE along with the SBE runtime planners, but left the base class in place. Since then there has been exactly one derived class, so the split shares nothing: every member of the base (_root, _rootData, _estimates, getWinningPlanStats(), buildExecPlanDebugInfo()) has a single caller.

      Proposed: merge the two classes into one. This also lets getPlanEntries() drop its
      virtual/override pair, which today exists only so the subclass can fall back to
      the base implementation for the QuerySolution-derived paths (join optimization, and when
      no classic runtime planner stage was handed over); those become private helpers.

      Secondary benefit: PlanExplainerSBEBase has no pure virtuals of its own, so nothing
      prevents constructing it directly and silently getting QuerySolution-only per-plan
      behavior. Merging removes that footgun.

            Assignee:
            Unassigned
            Reporter:
            Nicholas Zolnierz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: