[SERVER-13135] Some queries using 2dsphere indexes in 2.6 rc1 scan a *lot* more documents than 2.4 Created: 11/Mar/14 Updated: 11/Jul/16 Resolved: 13/Mar/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo, Performance |
| Affects Version/s: | 2.6.0-rc1 |
| Fix Version/s: | 2.6.0-rc2 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Rajesh Khot | Assignee: | hari.khalsa@10gen.com |
| Resolution: | Done | Votes: | 0 |
| Labels: | geospatial | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Operating System: | ALL |
| Steps To Reproduce: | Import the ps.json file in 2.4 and in 2.6 Run the query to see the difference in nScanned db.ps.find({'PROV_TIN_ADR.LATLONGDEGREE':{$near:{$geometry: {type : "Point" ,coordinates : [-78.898619,35.9940329] }, $maxDistance :482803}}}).limit(300).explain() |
| Participants: |
| Description |
|
Some geo-spatial queries in 2.6-rc1 scan a lot more documents than older versions. I have a 1.8 million doc collection. In 2.4, the query scans 440K rows, in 2.6, the query scans 1.4 million rows ===== 2.4 ==== , $maxDistance :482803}}}).limit(300).explain() }, =============== 2.6.rc1 ====================== db.ps.find({'PROV_TIN_ADR.LATLONGDEGREE':{$near:{$geometry: {type : "Point" ,coordinates : [-78.898619,35.9940329] } , $maxDistance :482803}}}).limit(300).explain() }, |
| Comments |
| Comment by Githook User [ 13/Mar/14 ] |
|
Author: {u'username': u'hkhalsa', u'name': u'Hari Khalsa', u'email': u'hkhalsa@10gen.com'}Message: |
| Comment by Githook User [ 13/Mar/14 ] |
|
Author: {u'username': u'hkhalsa', u'name': u'Hari Khalsa', u'email': u'hkhalsa@10gen.com'}Message: |
| Comment by Rajesh Khot [ 11/Mar/14 ] |
|
You will need to create the 2dsphere index before running the query.. db.ps.ensureIndex( {"PROV_TIN_ADR.LATLONGDEGREE" :"2dsphere"}) |