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

Large $in queries are several orders of magnitude slower

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker - P1
    • Resolution: Fixed
    • 2.6.0-rc1
    • 2.6.0-rc2
    • Querying
    • ALL
    • Hide

      build/run attached cpp file.

      Show
      build/run attached cpp file.

    Description

      Running the attached client as follows:

      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27249 100000
      Total query time in miliseconds: 389
      Doc count: 100000
      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27261 10000
      Total query time in miliseconds: 2103
      ben@zzyzx:~/projects/mongo-utils/build$ ./in_query localhost:27261 100000
      Total query time in miliseconds: 380121
      Doc count: 100000

      The last execution never returns a result, and the client is blocked in the call to DBClientCursor::more(). Note that the server logs the slow query at ~230ms on my machine, but the process continues to consume 100% cpu for 380 seconds.

      Attachments

        1. in_query_100_unindexed.svg
          117 kB
        2. in_query.cpp
          2 kB
        3. in_query.pdf
          8 kB
        4. in_query.svg
          42 kB
        5. server13100.js
          0.8 kB

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: