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

[SERVER] Investigate changes in SERVER-69056: 'explain' should include actual resource consumption costs when run with verbosity 'executionStats'

      Original Downstream Change Summary

      When explain is run with verbosity executionStats or higher, the "executionStats" now contain "operationMetrics" as well if profileOperationResourceConsumptionMetrics is enabled. These operationMetrics show runtime stats, if they are not zero. The stats are nested within "operationMetrics" which is nested in "executionStats." They include:

      "cpuNanos"
      "cursorSeeks"
      "docBytesRead"
      "docBytesWritten"
      "docUnitsRead"
      "docUnitsReturned"
      "docUnitsWritten"
      "idxEntryBytesRead"
      "idxEntryBytesWritten"
      "idxEntryUnitsRead"
      "idxEntryUnitsWritten"
      "totalUnitsWritten"
      "keysSorted"
      "sorterSpills"

      Description of Linked Ticket

      Original title: 'explain' should include estimated resource consumption costs
      In order to make it easier for MongoDB users to tally resource consumption costs for Serverless, it would be useful for resource consumption to be returned as part of the 'explain' output.

      Example:

      test> db.foo.find({}).explain()
      {
        explainVersion: '1',
        queryPlanner: {
          namespace: 'test.foo',
          indexFilterSet: false,
          parsedQuery: {},
          queryHash: '17830885',
          planCacheKey: '17830885',
          maxIndexedOrSolutionsReached: false,
          maxIndexedAndSolutionsReached: false,
          maxScansToExplodeReached: false,
          winningPlan: { stage: 'COLLSCAN', direction: 'forward' },
          rejectedPlans: []
        },
        command: { find: 'foo', filter: {}, '$db': 'test' },
        operationMetrics: { docBytesRead: 51, docUnitsRead:2 }
      

            Assignee:
            david.hou@mongodb.com David Hou
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              2 weeks, 6 days ago