Investigate caching behavior for subplanning if engine decision needs whole plan

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Subplanning can cache each branch of the $or, or cache the entire plan if it falls back to planning the whole query together. For the first case, we need to make the engine decision once each branch is finished planning, which would require a refactor of the existing subplanner code.

      Instead of a callback once each branch is finished planning, we may need to construct the final composite plan, decide which engine to use, then cache each branch.

      For this ticket we'll investigate the subplanning code to assess how complicated this may be, and come up with an approach.

      https://github.com/10gen/mongo/blob/9a3e2cccb02cd8be017fb3d3ba575e8a9708043b/src/mongo/db/exec/runtime_planners/classic_runtime_planner/sub_planner.cpp#L42-L53

      https://github.com/10gen/mongo/blob/9a3e2cccb02cd8be017fb3d3ba575e8a9708043b/src/mongo/db/exec/runtime_planners/classic_runtime_planner_for_sbe/sub_planner.cpp#L77

            Assignee:
            Ivan Fefer
            Reporter:
            Matt Boros
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: