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

2d nearSphere performance regression

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.0.2
    • 3.1.7
    • Geo
    • None
    • Fully Compatible
    • ALL
    • Hide

      Set up a mongo nodes running 2.6 and 3.0 and import the attached dataset

      mongoimport -d test -c test_collection --jsonArray 2d-regression-date-range.json 
      

      Create 2d index and _created_at index

      db.test_collection.createIndex({ "location": "2d" })
      db.test_collection.createIndex( { "_created_at": 1 } )
      

      Compare number of scanned documents and query duration on 2.6 and 3.0

      db.test_collection.find({ location: { $nearSphere: [ 106.6331, 10.7395 ] }, 
      _created_at: {"$lte" : ISODate("2015-01-23T17:59:44Z"), "$gte" : ISODate("2015-01-23T01:59:44Z")}}).limit(100)
      

      Show
      Set up a mongo nodes running 2.6 and 3.0 and import the attached dataset mongoimport -d test -c test_collection --jsonArray 2d-regression-date-range.json Create 2d index and _created_at index db.test_collection.createIndex({ "location": "2d" }) db.test_collection.createIndex( { "_created_at": 1 } ) Compare number of scanned documents and query duration on 2.6 and 3.0 db.test_collection.find({ location: { $nearSphere: [ 106.6331, 10.7395 ] }, _created_at: {"$lte" : ISODate("2015-01-23T17:59:44Z"), "$gte" : ISODate("2015-01-23T01:59:44Z")}}).limit(100)
    • RPL 6 07/17/15, RPL 7 08/10/15, RPL 8 08/31/15

    Description

      So just querying for coordinates appear to be much better thanks to SERVER-17469. However, after more testing I noticed that if I include a date range in the query there is a pretty significant performance regression between 2.6 and 3.0. I've attached a second export(2d-regression-date-range.tar.gz) that is the same as the previous export but with an additional _created_at field.

      2.6
      millis: 81
      nscanned: 35252
      nscannedObjects: 20345
      3.0
      executionTimeMillis: 2726
      totalKeysExamined: 1037671
      totalDocsExamined: 744461

      Attachments

        Issue Links

          Activity

            People

              siyuan.zhou@mongodb.com Siyuan Zhou
              dynamike Michael Kania
              Votes:
              3 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: