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

Cache single solution query plans

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Query Optimization
    • QO 2024-03-18, QO 2024-04-01, QO 2024-04-15, QO 2024-04-29

      SERVER-75506 cached single solution plans in the classic engine 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 may be faster in most cases 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).

            Assignee:
            jess.balint@mongodb.com Jess Balint
            Reporter:
            dan@mongodb.com Daniel Pasette (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            26 Start watching this issue

              Created:
              Updated: