inconsistent naming for indexOnly between cursor.explain() and aggregation explain

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Minor - P4
    • 2.5.3
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The cursor.explain() output includes a field called "coveredIndex":

      > db.zips.find({city: "NEW YORK"}).explain()
      {
      	"cursor" : "BtreeCursor city_1",
      	"isMultiKey" : false,
      	"n" : 40,
      	"nscannedObjects" : 40,
      	"nscanned" : 40,
      	"nscannedObjectsAllPlans" : 40,
      	"nscannedAllPlans" : 40,
      	"scanAndOrder" : false,
      	"indexOnly" : false,
      	"nYields" : 0,
      	"nChunkSkips" : 0,
      	"millis" : 0,
      	"indexBounds" : {
      		"city" : [
      			[
      				"NEW YORK",
      				"NEW YORK"
      			]
      		]
      	},
      	"server" : "localhost:27017"
      }
      

      For the equivalent field, aggregation explain uses the name "coveredIndex":

      db.runCommand({ aggregate: "zips", explain: true, pipeline: [ {$match: {city: "NEW YORK"}} ] })
      {
      	"stages" : [
      		{
      			"$cursor" : {
      				"query" : {
      					"city" : "NEW YORK"
      				},
      				"coveredIndex" : false,
      				"cursorType" : "BtreeCursor city_1"
      			}
      		}
      	],
      	"ok" : 1
      }
      

      Let's unify our terminology by changing explain for aggregation to "indexOnly".

            Assignee:
            Mathias Stearn
            Reporter:
            David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: