ExportXMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The join plan cache key now includes query settings: SERVER-137120, which follows the same approach as the classic planner. Queries with the same shape but different settings that don't affect the plan selection (comment, maxTimeMS) get different cache entries, since the hash function and equality check on JoinPlanCacheKey are not aligned. These entries hold equivalent plans, so we store duplicates and may replan equivalent queries. 

      Empty and unset queryKnobs may also produce equivalent plans, but they are keyed differently because of the current equality operator. Same with unset reject and false reject.

      Proposed fix: discard settings that don't affect plan selection from the cache key, maybe using one of:

      1. Normalize settings in the JoinPlanCacheKey constructor by dropping comment and maxTimeMS, and treating empty knobs the same as unset knobs.
      2. Rewrite operator== to compare only the settings that are hashed, so that equality and hashing agree. 

            Assignee:
            Unassigned
            Reporter:
            Jamie Tsai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: