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

Add more granular options to $sample

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

      Adding some more granular options to influence the $sample behaviour to improve:

      • Consistency in sample size (as a percentage vs a fixed size)
      • Sampling method (rnd cursor vs collscan)

      For example:

      db.example.aggregate([{
        $sample: {
          percent: 10,
          method: "cursor"
        }
      }]);
      
      • The parameter for "size" and "percent" would be exclusive options
      • The [optional] parameter for "method" would take a value of "cursor", "scan" or "auto", defaulting to auto (representing the current implementation

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            luke.prochazka@mongodb.com Luke Prochazka
            Votes:
            4 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated: