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

Cache QuerySettings hash, such that it does not have to be recomputed for plan cache lookup

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Query Execution

      As part of SERVER-79181 we introduce QuerySettings into PlanCacheKey. PlanCacheKey has a planCacheKeyHash() method that is used to compute hash of the key.

      Now when computing the hash, hash of the QuerySettings is also computed and then later combined and returned.

      We could avoid hash computation of QuerySettings as part of the planCacheKeyHash() as its hash can be computed once as part of setQuerySettings, cached in QuerySettingsManager and then later returned as part of the QuerySettings lookup.

      This way QuerySettings hash value will be computed only once, which should improve the overall performance on the hot path.

       

      First we need to profile to check how much time is spent computing the hash and then decide whether or not it is worth caching it

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            denis.grebennicov@mongodb.com Denis Grebennicov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: