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

Use readOnce: true for $sample cursors

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.1.7
    • Component/s: Aggregation Framework
    • Query Execution
    • Query 2020-03-23

      This is a feature request to enhance the behaviour of the $sample aggregation command by adding to the plan optimizer the WiredTiger “readOnce: true” option for MongoDB cursors (SERVER-36068).

      The intended purpose behind this enhancement is so $sample does not (or is less likely to) cache the result set.  A sample by definition is unlikely to be used again by subsequent samples, thereby caching has no benefit and only serves to add unwanted cache pressure and workload contention. 

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            luke.prochazka@mongodb.com Luke Prochazka
            Votes:
            1 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated: