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

Provide fast (estimated) count command

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Sprint:
      Query 2017-05-08

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: