[COMPASS-3927] Disabling SAMPLE MODE in Aggregations does not work for a high number of documents collection. Created: 10/Oct/19  Updated: 29/Oct/23  Resolved: 28/Nov/19

Status: Closed
Project: Compass
Component/s: Compass
Affects Version/s: 1.19.12
Fix Version/s: 1.20.0

Type: Bug Priority: Major - P3
Reporter: Tanna Matan Assignee: Maurizio Casimirri
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Documentation Changes: Not Needed
Sprint: Iteration Ragamuffin, Iteration Snake

 Description   

Disabled SAMPLE MODE in Aggregations does not work for a high number of documents collection.

Steps to reproduce:

1. In Aggregations page, disable the SAMPLE MODE.
2. Use $group with below query. This will result in the count of the documents to this stage.

{
    _id : null,
    count : {
       $sum : 1
    }
}

3. The result displays the number of LIMIT configured or 100000 by default.

My hypothesis is the number of documents plays a part in the issue and have asked the customer to test with other collections. Please see the below table that describes the relation of this issue with the number of documents in a collection.
Note, I do not see any document note that the SAMPLING will be force used if the number of documents exceeds X number.

Number of documents in a collection Disabling SAMPLE MODE Work?
- -
26 Yes
1 million Yes
1.3 million Yes
6 million No
33.2 million No

Generated at Wed Feb 07 22:34:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.