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

Introduce PlanCache interface

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Optimization

      As part of the SBE plan cache project, we now have two separate plan cache implementations: mongo::PlanCache and mongo::sbe::PlanCache. The former is the legacy implementation which stores index tags, and the latter is the SBE-specific cache which stores SBE plans. These two plan caches share much of their logic, and differ largely in the representation of the cached plan. At the moment, code sharing has been achieved with a PlanCacheBase template class. This is convenient because the underlying data structure is LRUKeyValue which is also templated on the key and value types.

      However, there are various places in the code where we would like to perform the same actions against both plan caches (e.g. when we need to flush cache contents due to the creation of an index filter). At the moment this cannot be easily abstracted across both plan caches without a template function. In order to avoid this kind of "infectious" templatization effect, it would be convenient to have a PlanCache interface allowing runtime polymorphism. We should introduce a PlanCache interface but still share code between the SBE and classic implementations using the templated base class.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: