Skip to content

Alec

My feedback

1 result found

  1. 10 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    2 comments  ·  Database  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    Alec commented  · 

    To build on this, we have really bad performance doing a `countDocuments()` call on a covered index. It takes >5s on a collection with:

    ```
    totalKeysExamined: 769298,
    totalDocsExamined: 0,
    ```

    I get that under the hood, the countDocuments() needs to scan the index, so will have O(n) time.

    Since we want to call this count frequently (ideally every minute), it would be nice if this wasn't so bad. An acceptable workaround for us would be building a partial index with a filter that matches our countDocuments() filter, and then it would be really nice if we could get a estimatedCountDocuments() from the metadata of the index size, which is currently unavailable at the index level

    Alec supported this idea  · 

Feedback and Knowledge Base