Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2194

`CountDocuments` slowly

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Gone away
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Not Needed

    Description

      use `CountDocuments` to get count is slowly than useing mongoshell, By looking log of mongodb, it seems like `CountDocuments` will use `aggregate` to compute count.

      mongoshell spend 1660ms, `CountDocuments` spend 2436ms. the filter count is 349326,  the collection count is 19492668, and i have created index.

      Are there any way to improve the performance?

      Attachments

        Activity

          People

            benji.rewis@mongodb.com Benji Rewis (Inactive)
            mrliuxiansen8023@gmail.com du liu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: