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

nscannedObjects incorrect in explain output for query against compound text index

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

      > 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 Unassigned
            Reporter:
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: