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

Convert PlanCache to a template class

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1.0-rc0
    • Component/s: Query Planning
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      QE 2021-09-06

      Description

      We plan to make the current PlanCache more generic so that it can be used to implement both the existing plan cache for the classic engine, as well as the SBE plan cache. We will have a PlanCacheBase<KeyType, CachedPlanType> base class which has template parameters for the type of the plan cache key as well as the type of cached plan. The SBE/classic plan classes will each instantiate this template class.

      As a first step, we need to do a bit of surgery to the current PlanCache in order to turn it into a template class. We should try to do this as mechanically as possible to keep this first patch relatively simple. A few notes:

      • There will be a lot of code motion here. We need to move most of the code in plan_cache.cpp into the header file in order to templatize the necessary types.
      • Right now you can't use logv2 from a header file. We'll have to deal with this. We handled this elsewhere by making the templated code call simple helper functions to do the logging. Example here.
      • You'll need to turn not only PlanCache but also CachedSolution and PlanCacheEntry into template classes.
      • This patch won't actually interact at all with the SBE plan cache just yet. We will have template instantiations only for the classic engine. This is just prep work.

        Attachments

          Activity

            People

            Assignee:
            joshua.lapacik Joshua Lapacik
            Reporter:
            david.storch David Storch
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: