[SERVER-22743] Provide fast (estimated) count command Created: 18/Feb/16 Updated: 14/Jun/17 Resolved: 14/Jun/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Osmar Olivo | Assignee: | David Storch |
| Resolution: | Won't Fix | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Sprint: | Query 2017-05-08 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
Today, depending on the context used, when .count() is used it will either do an expensive count operation to ensure accurate results, or it will invoke a data structure through a routine called fastCount that provides a rough estimate of the number of documents in a collection/database. This can be confusing to users who expect the count operation to be an accurate precise count every time. We should deprecate count command and add a countEstimate command. countEstimate will be O(1) though inaccurate and whenever users require an accurate count they should use the aggregation framework's facility for counting. The name countEstimate should be used in the stats data as well for clarity. |
| Comments |
| Comment by David Storch [ 14/Jun/17 ] |
|
We are no longer planning to add a countEstimate command, so I am closing this ticket as "Won't Fix". Instead, we plan to implement |