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

Consider changing DocumentSourceSequentialCache to own its own cache.

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

      Right now DocumentSourceSequentialCache (DSSC) is created by DocumentSourceLookup and the lookup stage maintains ownership of the cache across iterations of doGetNext. When the pipeline is cloned, we wind up with multiple DSSC stages pointing to the same cache. For lookup this is fine as only one copy is ever used, but it means that for DSSC clone() is potentially risky if we want to use it in a situation where we'd want multiple stages with unique caches (stages across multiple pipelines). There may not actually be any work for this ticket if we decide to leave as is – this situation isn't likely to come up.

      Lookup currently owns the cache because it needs the cache to outlive multiple calls to buildPipeline. The purpose of this ticket is to figure out if there is a way that we could maintain that property while making clone() make more sense.

            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            ted.tuckman@mongodb.com Ted Tuckman
            0 Vote for this issue
            1 Start watching this issue