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

Cache $lookup inner query plans with single solution

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • QO 2023-04-03, QO 2023-04-17
    • 35

      For $lookup inner queries that have only one query solution, we do not multiplan and therefore do not cache. However caching these plans is beneficial to performance, we are seeing an 8% overall improvement in TPCH Q11 throughput and 3% improvement in TPCH Q7.

      To avoid affecting a large class of queries, we should only force the cache when the query comes from a lookup. We can set a variable via the ExpressionContext to communicate this flag.

      Slack discussion

            matt.boros@mongodb.com Matt Boros
            matt.boros@mongodb.com Matt Boros
            0 Vote for this issue
            7 Start watching this issue