count times out when there are over 10 million records and there is a find query used

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 4.2.5
    • Component/s: Performance
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We are currently experiencing a major issue in our API.  We have a call that allows the ability to get all users from a collection in mongo.  To increase API performance we implemented pagination.  Once we have over 10 million objects the call times out.  There is only one restriction when querying the users and that is that the users must be active.  We have indexed that field properly and just a find({active:true}) returns lightning fase, but for pagination we need to know total elements, so count({active:true}) takes over 30 seconds.  How can we fix this moving forward?

            Assignee:
            Unassigned
            Reporter:
            Ryan Kaltreider
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: