Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-22743

Provide fast (estimated) count command

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      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.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            osmar.olivo Osmar Olivo
            Votes:
            1 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: