nscannedObjects incorrect in explain output for query against compound text index

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.6.0-rc0
    • Component/s: Text Search
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      > db.foo.ensureIndex({a:"text",b:1})
      WriteResult({ "nInserted" : 1 })
      > db.foo.insert({a:"hello world",b:1})
      WriteResult({ "nInserted" : 1 })
      > db.foo.find({$text:{$search:"hello"},b:1})
      { "_id" : ObjectId("531518053d6c9988adb3eed4"), "a" : "hello world", "b" : 1 }
      > db.foo.find({$text:{$search:"hello"},b:1}).explain()
      {
      	"cursor" : "TextCursor",
      	"n" : 1,
      	"nscannedObjects" : 0, // Incorrect, should be 1 (query fetches "_id" and "a" from document)
      	"nscanned" : 1,
      	"nscannedObjectsAllPlans" : 0,
      	"nscannedAllPlans" : 1,
      	"scanAndOrder" : false,
      	"nYields" : 0,
      	"nChunkSkips" : 0,
      	"millis" : 0,
      	"server" : "Rassi-MacBook-Pro.local:27017",
      	"filterSet" : false
      }
      >
      

              Assignee:
              Unassigned
              Reporter:
              J Rassi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: