Ensure “usedJoinOptimization” field appears in explain for express-eligible queries

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Trivial - P5
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In  SERVER-113732, we decided that when a query is not eligible for join optimization, but the join optimization flag is enabled, we should include "usedJoinOptimization":false in the explain output. This does not occur if the base collection uses an express plan.

      For example

      db.foo.explain().aggregate([{$match: {_id: 0}}, {$lookup: {from: "bar", localField: "a", foreignField: "a", as: "res" }}])

      This query is not eligible for join optimization because it’s missing an $unwind, so when the join opt flag is enabled, we would expect to see "usedJoinOptimization":false in the explain output, but it is missing.

            Assignee:
            Maddie Zechar
            Reporter:
            Hana Pearlman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: