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

Combining $comment and .count() degrades performance

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.2
    • Component/s: Querying
    • Labels:
    • Backwards Compatibility:
      Major Change
    • Operating System:
      ALL
    • Sprint:
      Query 10 (02/22/16)

      Description

      When passing a $comment in a query count() doesn't use an index.

      Testcase:

      > for (var i=0; i < 1000000; i++) db.test.insert({a:i})
      > db.test.count()
      1000001
      > db.test.count({$comment:"A"})
      1000001
      > var start = new ISODate(); db.test.count(); new ISODate() - start
      0
      > var start = new ISODate(); db.test.count({$comment:"A"}); new ISODate() - start
      155
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              charlie.swanson Charlie Swanson
              Reporter:
              alonho Alon Horev
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: