[SERVER-59708] Make plan_explainer plan cache functionality generic Created: 01/Sep/21  Updated: 29/Oct/23  Resolved: 03/May/23

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

Type: Improvement Priority: Major - P3
Reporter: Joshua Lapacik (Inactive) Assignee: Peter Volk
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-64432 supporting caching SBE Plan for $lookup Closed
depends on SERVER-61507 Integrate $group lowering with the ne... Closed
Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Sprint: QO 2023-05-15
Participants:

 Description   

`plan_explainer.h` is a generic interface that shouldn't depend on either of the classic or SBE flavor of plan cache. At the moment it depends on the classic plan cache due to the method `getCachedPlanStats()`.



 Comments   
Comment by Githook User [ 04/May/23 ]

Author:

{'name': 'Peter Volk', 'email': 'peter.volk@mongodb.com', 'username': 'HCSPete'}

Message: SERVER-59708 Make plan_explainer plan cache functionality generic
Branch: master
https://github.com/mongodb/mongo/commit/3f9a346c19b65d8e110080bd8109cdf7be103cc1

Comment by David Storch [ 05/Jul/22 ]

The getCachedPlanStats() method is only called by the code used for serializing plan cache entries to BSON to support the $planCacheStats aggregation stage. It looks like the only callers are here. At the moment, it is still possible for us to use the classic cache for plans recovered from the cache that execute in SBE. This is currently possible when featureFlagSbePlanCache is disabled, but after SERVER-61314 we will only use the classic cache together with SBE when featureFlagSbeFull is disabled.

Once the classic cache is only used with the classic engine (never with SBE) then getCachedPlanStats can become a non-virtual function and we can delete the implementation from PlanExecutorSBE. I'm moving this ticket to the backlog and marking it "neweng", since it should be a pretty simple task once featureFlagSbeFull is a thing of the past.

Comment by Anton Korshunov [ 04/Apr/22 ]

We can do this refactor only once we add support for $group and $lookup queries in SBE plan cache when we stop caching plans in the classic cache for SBE queries.

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