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

Explain on 2dsphere find query includes "nscanned" twice, and some other inconsistencies

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Done
    • Affects Version/s: 2.4.0-rc2
    • Fix Version/s: None
    • Component/s: Geo, Querying
    • Labels:
      None
    • Operating System:
      ALL

      Description

      Steps to reproduce:

      db.places.drop()
      db.places.ensureIndex({loc: "2dsphere"})
      db.places.insert({loc: {type: "Point", coordinates: [10, 10] }, name: "restaurant"})
      db.places.find({loc: {"$geoWithin": {"$geometry": {type: "Polygon", coordinates: [ [ [5, 5], [12, 8], [10, 15], [5, 5] ] ] } } } }).explain()

      Returns:

      {
      	"cursor" : "S2Cursor",
      	"isMultiKey" : true,
      	"n" : 1,
      	"nscannedObjects" : 1,
      	"nscanned" : 2,
      	"nscannedObjectsAllPlans" : 1,
      	"nscannedAllPlans" : 2,
      	"scanAndOrder" : false,
      	"indexOnly" : false,
      	"nYields" : 0,
      	"nChunkSkips" : 0,
      	"millis" : 1,
      	"indexBounds" : {
      		
      	},
      	"nscanned" : 2,
      	"matchTested" : NumberLong(1),
      	"geoTested" : NumberLong(1),
      	"cellsInCover" : NumberLong(13),
      	"server" : "capslock.local:27017"
      }

      Do they have different meanings? Or should one be removed?

      It's also strange that the value is 2, when I only have 1 document in the collection. Is that a property of the 2dsphere index? Or multi-key?

      Lastly, why do matchTested, geoTested, cellsInCover output their values as NumberLong(..) values?

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: