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

$nearSphere with 2dsphere index (S2NearCursor) shows incorrect statistics

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Duplicate
    • 2.6.5
    • None
    • Geo, Querying
    • None
    • Fully Compatible
    • ALL
    • Hide

      db.createCollection("c")
      db.c.ensureIndex({xid: 1, pos: "2dsphere"})
      db.c.find({xid: ObjectId("5475cdeeb307f5e9b8550e6d"), pos: { $nearSphere: [ 0, 0 ], $maxDistance: 0.1}}).explain()

      Show
      db.createCollection("c") db.c.ensureIndex({xid: 1, pos: "2dsphere"}) db.c.find({xid: ObjectId("5475cdeeb307f5e9b8550e6d"), pos: { $nearSphere: [ 0, 0 ], $maxDistance: 0.1}}).explain()

    Description

      This is evident from performing the query directly on an empty collection that does not contain any documents.

      db.c.find({xid: ObjectId("5475cdeeb307f5e9b8550eaa"), pos: { $nearSphere: [ 0, 0 ], $maxDistance: 1}}).explain()

      {
      	"cursor" : "S2NearCursor",
      	"isMultiKey" : false,
      	"n" : 0,
      	"nscannedObjects" : 26,
      	"nscanned" : 26,
      	"nscannedObjectsAllPlans" : 26,
      	"nscannedAllPlans" : 26,
      	"scanAndOrder" : false,
      	"indexOnly" : false,
      	"nYields" : 0,
      	"nChunkSkips" : 0,
      	"millis" : 8,
      	"indexBounds" : {
      		
      	},
      	"server" : "aks-osx.local:37018",
      	"filterSet" : false
      }

      This issue is not seen in 2.8.

      Attachments

        Issue Links

          Activity

            People

              david.storch@mongodb.com David Storch
              anil.kumar Anil Kumar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: