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

Correctly fill execution stats for allPlansExecution when cqPipeline is present

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Execution
    • Fully Compatible
    • v7.0, v6.0
    • QE 2024-03-18, QE 2024-04-01

      In SBE, if you run explain("allPlansExecution") on a query  that have extra pipeline stages pushed down (for example, $group), execution stats for rejected plans will be all zeros.

      That is because we extend rejected plans with aggregation pipeline only in explain(), resetting execution stats.

      https://github.com/mongodb/mongo/blob/83be8a3f59780501b7469e08b1cd2ac318f8ca86/src/mongo/db/query/sbe_multi_planner.cpp#L377

      allPlansExecution is an important debug tool for SBE multi planner that we should fix.

       

      For example, for allPlansExecution purposes, we don't have to extend the plans with an agg pipeline, because agg pipeline doesn't affect plan selection anyway. This is the way it is done in classic multiplanner for SBE.

      Also, users on version 6.0 and 7.0 only use SBE when we have a $group or $lookup, so this is completely broken for them. We should fix and backport this.

            Assignee:
            evan.bergeron@mongodb.com Evan Bergeron
            Reporter:
            ivan.fefer@mongodb.com Ivan Fefer
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: