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

Performance regression with smaller $in queries

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.6.0-rc1
    • Fix Version/s: 2.6.0-rc2
    • Component/s: Querying
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      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

        Attachments

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

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: