Add more granular options to $sample

XMLWordPrintableJSON

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

      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:
            [DO NOT USE] Backlog - Query Optimization
            Reporter:
            Luke Prochazka
            Votes:
            4 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated: