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

Performance regression with smaller $in queries

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.0-rc2
    • Affects Version/s: 2.6.0-rc1
    • Component/s: Querying
    • Fully Compatible
    • ALL

      100-element $in queries appear to be an order of magnitude slower in v2.6.0-rc1 (even with lower_bound patch) than in v2.4.9:

      Using the attached code:

      v2.4.9:

      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27017 100
      Total query time in miliseconds: 17
      Doc count: 10000
      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27017 100
      Total query time in miliseconds: 7
      Doc count: 10000
      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27017 100
      Total query time in miliseconds: 6
      Doc count: 10000
      

      RC1:

      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27017 100
      Total query time in miliseconds: 101
      Doc count: 10000
      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27017 100
      Total query time in miliseconds: 82
      Doc count: 10000
      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27017 100
      Total query time in miliseconds: 104
      Doc count: 10000
      

      RC1 with binary search

      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27017 100
      Total query time in miliseconds: 103
      Doc count: 10000
      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27017 100
      Total query time in miliseconds: 63
      Doc count: 10000
      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27017 100
      Total query time in miliseconds: 88
      Doc count: 10000
      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27017 100
      Total query time in miliseconds: 102
      Doc count: 10000
      

      RC1 with lower_bound:

      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27017 100
      Total query time in miliseconds: 89
      Doc count: 10000
      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27017 100
      Total query time in miliseconds: 37
      Doc count: 10000
      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27017 100
      Total query time in miliseconds: 40
      Doc count: 10000
      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27017 100
      Total query time in miliseconds: 72
      Doc count: 10000
      

        1. in_query_100.svg
          101 kB
        2. in_query.cpp
          2 kB

            Assignee:
            benety.goh@mongodb.com Benety Goh
            Reporter:
            benjamin.becker Ben Becker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: