Improve plan cache insertion by resuming MP stage when CBR plan is chosen

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      One major improvement we can do to the plan cache insertion implementation of SERVER-116987 is to re-use the existing MP stage rather than building a new one to measure works. Once CBR has picked the best plan we can "prune" all the other plans from the existing MP stage from the MP first trial phase and then run that MP to completion which would give us plan caching for free.

      This approach could also simplify getting the $planCacheStats information into the cache since the MP stage could now be aware of its own rejected plans.

      This will also align with future work where we want to maintain the state of the existing MP stage rather than recompiling (SERVER-117277).

            Assignee:
            Unassigned
            Reporter:
            Naafiyan Ahmed
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: