-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
None
-
Query 2017-05-08
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.
- depends on
-
SERVER-7944 add index hint support for operations that read indexes
- Closed
- is related to
-
SERVER-22093 Take advantage of the COUNT_SCAN optimization when a pipeline has no dependencies
- Closed
-
SERVER-29620 Add shorthand syntax for retrieving the record count for a collection using the $collStats agg stage
- Closed