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

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

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.5.3
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • None
    • 0
    • 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@mongodb.com Mathias Stearn
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: