[SERVER-62762] Introduce PlanCache interface Created: 19/Jan/22  Updated: 06/Dec/22  Resolved: 31/Mar/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: Backlog - Query Optimization
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Optimization
Participants:

 Description   

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.



 Comments   
Comment by Anton Korshunov [ 31/Mar/22 ]

After discussing it at the team meeting we decided this work is not important enough for the plan cache project, so we're closing it as "Won't do".

Generated at Thu Feb 08 05:56:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.