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

Make "planningTimeMicros" incorporate time from the multi-planner trial period

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0, 7.0.10, 7.3.3, 7.0.11
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Optimization
    • Fully Compatible
    • v7.3, v7.2, v7.0
    • QO 2024-02-05

      The planningTimeMicros metric indicates the time spent by the system in the query optimization phase, and appears in the logs and system.profile output. I believe it was first added in SERVER-70646 for version 6.2.

      The current implementation incorporates the time spent enumerating and constructing plan alternatives, but it excludes the time spent in the multi-planner. This multi-planning phase can be quite expensive, since it is where we partially execute various candidate plans in order to gather runtime statistics. Furthermore, we've seen some reports of performance problems recently related to the SBE multi-planning implementation.

      In order to make "planningTimeMicros" more useful for detecting performance problems related to multi-planning, we should change the implementation so that this metric incorporates time spent multi-planning. Preferably we would make sure it works this way for both the classic engine and SBE. An additional benefit of this change is that it will make the metric more meaningful to compare apples-to-apples against Bonsai optimization time, since in both cases we will be measuring the total time that the system takes to determine the optimal physical query plan.

            Assignee:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: