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

Explain (and logs) should indicate when query planning thresholds are encountered

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • Query 2020-11-30, Query 2020-12-14

      There are a handful of parameters that influence the plan generation process.  Two examples would be internalQueryEnumerationMaxOrSolutions and internalQueryMaxScansToExplode.  When encountered, these modify the set of plans that are available for selection and can have an important impact on the overall efficiency of the query (eg SERVER-36393).

      In some situations, it is relatively easy to determine that such a threshold was encountered during planning with a high degree of confidence.  For example if the query shape is a (singled) contained $or and there are precisely ten plans that contain a "OR" stage then it is very likely that the deployment is using the default value of 10 for the internalQueryEnumerationMaxOrSolutions parameter and that the threshold was encountered during the planning process.  However it very quickly becomes difficult or impossible to definitively determine that these various thresholds were reached in an arbitrary situation.  

      We should report when the planner encounters these situations in explain output.  It is also worth considering adding this to the log output as well (verbose or otherwise).

            Assignee:
            ted.tuckman@mongodb.com Ted Tuckman
            Reporter:
            christopher.harris@mongodb.com Chris Harris
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: