Slow collection.count() with MongoDB protocol RRS feed

  • Question

  • Hi,

    I'm using DocumentDB with protocol support for MongoDB and experiencing slow execution of db.collection.count(query). For an expected count = 100K with a throughput 10,000 RU/s it takes almost half a minute.

    Same for both MongoDB.Driver and MongoChef.

    How can it be speeded up?

    Thursday, October 27, 2016 3:27 PM

All replies

  • Hi Vitaliy,

    Apologies for the slow executing queries. This is not indicative of most queries run on DocumentDB (protocol support for MongoDB).

    Can you drop us a mail at askdocdb [at] microsoft [dot] com with your subscriptionId and account name so that we can take a closer look at the query plans?



    Thursday, October 27, 2016 5:24 PM
  • I am facing the exact same problem. a count is taking me almost a minute with only (5k as number returned).

    this number is a result of a filter on 300k rows.

    SQL would return this in less than a sec. Is there anything i'm doing wrong?

    Monday, June 11, 2018 12:58 PM
  • I am getting same speed issue. more record(s) in collection taking more time. if running query on collection with 20,000 record(s). it takes around 11 second.


    Please help.


    Thursday, September 5, 2019 8:29 PM
  • Please reach-out to the product group at askcosmosmongoapi

    I have verified the correct email address, as the email address is not correct above.



    Tuesday, September 17, 2019 5:52 PM