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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Duplicate
    • Affects Version/s: 2.6.5
    • Fix Version/s: None
    • Component/s: Geo, Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      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

              Assignee:
              david.storch David Storch
              Reporter:
              anil.kumar Anil Kumar
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: