Allow storage engines to provide optimized random cursors for use by $sample

XMLWordPrintableJSON

    • Fully Compatible
    • Quint Iteration 7
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      The initial implementation of $sample will involve a collection scan if it is the first stage in the pipeline. This could be dramatically improved if we exposed a way for storage engines to provide a random cursor that would do something more efficient like a random walk on a B-Tree to get pseudo-random results.

      This will only track the storage engine API and WiredTiger implementation of getRandomCursor(), work on integrating this into the aggregation pipeline will be tracked on SERVER-19182

            Assignee:
            Geert Bosch
            Reporter:
            Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: