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

incorrect nscannedObjects for explain for index intersection

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 2.5.5
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      There is an index on city and on state:

      geo@local(2.5.5) > db.zips.find({city:"HAZARD"}).explain()
      {
      	"cursor" : "BtreeCursor city_1",
      	"isMultiKey" : false,
      	"n" : 2,
      	"nscannedObjects" : 2,
      	"nscanned" : 2,
      	"nscannedObjectsAllPlans" : 2,
      	"nscannedAllPlans" : 2,
      	"scanAndOrder" : false,
      	"indexOnly" : false,
      	"nYields" : 0,
      	"nChunkSkips" : 0,
      	"millis" : 0,
      	"indexBounds" : {
      		"city" : [
      			[
      				"HAZARD",
      				"HAZARD"
      			]
      		]
      	},
      	"server" : "asyasmacbook.local:27017"
      }
      geo@local(2.5.5) > db.zips.find({state:"CA"}).explain()
      {
      	"cursor" : "BtreeCursor state_1",
      	"isMultiKey" : false,
      	"n" : 1523,
      	"nscannedObjects" : 1523,
      	"nscanned" : 1523,
      	"nscannedObjectsAllPlans" : 1523,
      	"nscannedAllPlans" : 1523,
      	"scanAndOrder" : false,
      	"indexOnly" : false,
      	"nYields" : 11,
      	"nChunkSkips" : 0,
      	"millis" : 3,
      	"indexBounds" : {
      		"state" : [
      			[
      				"CA",
      				"CA"
      			]
      		]
      	},
      	"server" : "asyasmacbook.local:27017"
      }
      geo@local(2.5.5) > db.zips.find({city:"HAZARD",state:"CA"}).explain()
      {
      	"cursor" : "Complex Plan",
      	"n" : 1,
      	"nscannedObjects" : 0,
      	"nscanned" : 1525,
      	"nscannedObjectsAllPlans" : 0,
      	"nscannedAllPlans" : 1525,
      	"nYields" : 11,
      	"nChunkSkips" : 0,
      	"millis" : 1,
      	"server" : "asyasmacbook.local:27017"
      }
      geo@local(2.5.5) >

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: