[SERVER-85595] [Classic] Cache single solution plans Created: 23/Jan/24  Updated: 29/Jan/24  Resolved: 29/Jan/24

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

Type: Improvement Priority: Major - P3
Reporter: Matt Boros Assignee: Backlog - Query Optimization
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-13341 Cache single solution query plans Needs Scheduling
Related
related to SERVER-76684 Cached plans from inner $lookup singl... Open
Assigned Teams:
Query Optimization
Participants:

 Description   

SERVER-75506 cached single solution plans when inside a $lookup, and saw up to a 9% improvement in TPCH benchmarks with no confirmed regressions. We should consider caching all single solution plans to get this perf improvement.

Originally we did not cache single solution plans in classic to save space in the cache, and because planning was "fast enough". However the cache is clearly faster so we should look into this.

SBE plans are always cached, and from what I've seen through $planCacheStats, they tend to take more space as well (compared to classic SolutionCacheData). So in terms of space it seems okay to cache classic plans always (of course this should be tested, and I also understand that the capacity limits are different for classic and SBE caches).



 Comments   
Comment by David Storch [ 23/Jan/24 ]

matt.boros@mongodb.com I'd say that we should close this as a duplicate of SERVER-13341. Before going ahead with this, we should measure what kind of performance benefit this will actually give us. It's not clear to me without numbers that it's an obvious win.

Generated at Thu Feb 08 06:58:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.