[SERVER-38802] Add more granular options to $sample Created: 02/Jan/19  Updated: 23/Jun/23

Status: Backlog
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: 4.1.6
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Luke Prochazka Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 4
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-45474 $sample doesn't support variables or ... Backlog
is related to SERVER-72518 Make 5% random-cursor $sample cutoff ... Closed
Assigned Teams:
Query Optimization
Participants:
Case:

 Description   

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


 Comments   
Comment by Charlie Swanson [ 02/Jan/19 ]

Thanks luke.prochazka. I've moved it into 'Needs Scheduling' for the team to consider during our next triage meeting.

Generated at Thu Feb 08 04:50:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.