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

Geospatial index intersection errors when used with a compound index

    XMLWordPrintable

    Details

    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      db.foo.insert({fname:"MICKEY",lname:"MOUSE",state:"FL", loc:{type:"Point",coordinates:[-81.513743,28.369947]}})
       
      db.foo.ensureIndex({"lname":1,"state":1},{name:"MYINDEX"})
      db.foo.ensureIndex({loc:"2dsphere"})
       
      // This will fail
      db.foo.find({loc:{$near:{$geometry:{type:"Point",coordinates : [-81.513743,28.369947] }, $maxDistance :100}},lname:"MOUSE"})
       
       
      db.foo.dropIndex("MYINDEX")
      db.foo.ensureIndex({"lname":1},{name:"MYINDEX"})
       
      // This will work since MYINDEX is not a compound index
      db.foo.find({loc:{$near:{$geometry:{type:"Point",coordinates : [-81.513743,28.369947] }, $maxDistance :100}},lname:"MOUSE"})

      Show
      db.foo.insert({fname:"MICKEY",lname:"MOUSE",state:"FL", loc:{type:"Point",coordinates:[-81.513743,28.369947]}})   db.foo.ensureIndex({"lname":1,"state":1},{name:"MYINDEX"}) db.foo.ensureIndex({loc:"2dsphere"})   // This will fail db.foo.find({loc:{$near:{$geometry:{type:"Point",coordinates : [-81.513743,28.369947] }, $maxDistance :100}},lname:"MOUSE"})     db.foo.dropIndex("MYINDEX") db.foo.ensureIndex({"lname":1},{name:"MYINDEX"})   // This will work since MYINDEX is not a compound index db.foo.find({loc:{$near:{$geometry:{type:"Point",coordinates : [-81.513743,28.369947] }, $maxDistance :100}},lname:"MOUSE"})

      Description

      Geospatial index query fail's when a non-geo field in the query is a part of a compound index. Perhaps a bug in the new 2.6 index intersection feature

      error:

      { "$err" : "assertion src/mongo/db/exec/s2near.cpp:65" }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hari.khalsa@10gen.com hari.khalsa@10gen.com
              Reporter:
              rajeXsh Rajesh Khot
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: