Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-3187

Difference between nscanned and nscannedObjects is unclear

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • v1.3.7
    • Affects Version/s: mongodb-2.6
    • Component/s: manual
    • Labels:
      None
    • Environment:
      All

      On this page http://docs.mongodb.org/manual/reference/method/cursor.explain/#explain-output-fields-core

      The explanation of the difference between nscanned and nscannedObjects in the explain plan is unclear.

      Need to define the specific differences between the two outputs and give a clear example of a query that will produce different outputs.

      e.g.

      explain.nscannedObjects
      Specifies the total number of documents scanned during the query. The nscannedObjects may be lower than nscanned, such as if the index covers a query. See indexOnly. Additionally, the nscannedObjects may be lower than nscanned in the case of multikey index on an array field with duplicate documents.

      explain.nscanned
      Specifies the total number of documents or index entries scanned during the database operation. You want n and nscanned to be close in value as possible. The nscanned value may be higher than the nscannedObjects value, such as if the index covers a query. See indexOnly.

            Assignee:
            tim.slavin Tim Slavin
            Reporter:
            joe.drumgoole@mongodb.com Joe Drumgoole (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              9 years, 30 weeks, 6 days ago