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

Investigate changes in SERVER-40755: Expose statistics which indicate how many collection scans have executed

      Description

      Downstream Change Summary

      The number of tailable and non-tailable collection scans are now reported in the metrics.queryExecutor.collectionScans section of serverStatus output:

      MongoDB Enterprise > db.serverStatus().metrics.queryExecutor.collectionScans
      { "nonTailable" : NumberLong(0), "total" : NumberLong(0) }
      

      These stats can also be retrieved on a per-collection basis using the queryExecStats option to the $collStats aggregation stage:

      MongoDB Enterprise > db.c.aggregate([{$collStats: {queryExecStats: {}}}])
      { "ns" : "test.c", "host" : "storchbox:27017", "localTime" : ISODate("2020-05-26T19:44:04.850Z"), "queryExecStats" : { "collectionScans" : { "total" : NumberLong(0), "nonTailable" : NumberLong(0) } } }
      

      Description of Linked Ticket

      It is unclear how prevalent are data scans. Having statistics on collection and index scans would allow us to decided if improvements in this area are critical for the overall performance.

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

            Assignee:
            john.williams@mongodb.com John Williams
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              3 years, 45 weeks, 3 days ago