Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-14045

Investigate changes in SERVER-48625: explain() output structure in 5.0

    XMLWordPrintableJSON

Details

    Description

      Description

      Downstream Change Summary

      This ticket adds fields to explain for the following three query parameters: internalQueryMaxScansToExplode (maxScansToExplodeReached), internalQueryEnumerationMaxOrSolutions (maxIndexedOrSolutionsReached), and internalQueryMaxIntersectPerAnd (maxIndexedAndSolutionsReached). When the planner hits the limits set with these knobs, the value in explain will be set to "true" and a message will be logged at log level 1. If the user does not change the values of these knobs, they will still be set if the planner hits the default limits.

      Description of Linked Ticket

      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).

      Scope of changes

      1. https://docs.mongodb.com/manual/reference/explain-results/index.html
        1. Be sure to document output for both sharded and unsharded collections.
      2. https://docs.mongodb.com/manual/reference/method/db.collection.explain/index.html
      3. https://docs.mongodb.com/manual/reference/method/cursor.explain/index.html
      4. https://docs.mongodb.com/manual/reference/operator/meta/explain/index.html
      5. https://docs.mongodb.com/manual/reference/command/explain/index.html

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

      Attachments

        Activity

          People

            joseph.dougherty@mongodb.com Joseph Dougherty
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              2 years, 39 weeks, 2 days ago