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

Metric "document.scanned" is not the same as nscannedObjects (from explain)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 2.4.0-rc2
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      The scanned value comes from cursor.scanned() which is not the same as the docs loaded/scanned (nscannedOjbects in explain) but is instead the indexes (entries) scanned or number of docs returned.

      This can be shown easily using a covered query:

      > var firstSS = db.serverStatus()
      > db.g.find({b:2},{ b:1, _id:0}).explain()
      {
      	"cursor" : "BtreeCursor b_1",
      	"isMultiKey" : false,
      	"n" : 2,
      	"nscannedObjects" : 0,
      	"nscanned" : 2,
      	"nscannedObjectsAllPlans" : 0,
      	"nscannedAllPlans" : 2,
      ...}
      > db.serverStatus().metrics.document.scanned - firstSS.metrics.document.scanned
      2
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: