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

Cache SBE plans for queries that specify a hint

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Query Planning
    • None
    • Query Optimization

      james.wahlin@mongodb.com brought up a good point: the SBE plan cache aims to prevent the cost of query recompilation even for queries that have just a single possible QuerySolution. Historically for the classic plan cache, queries which specified a hint were ineligible for plan caching. I'm guessing this was because 1) the initial implementation of the classic plan cache wouldn't have worked correctly for queries with a hint, and 2) it didn't matter anyway since the main purpose of the classic plan cache was to avoid multi-planning. In contrast, this could actually make a difference for SBE due to the relatively higher cost of query compilation.

      The work for this ticket is to cache queries with a hint in the SBE plan cache. I would recommend that we leave the classic plan cache as is, so that the change applies only to the SBE plan cache. My guess is that this should more or less work out of the box as long as we are careful to start encoding the hint into the SBE plan cache key.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: