[SERVER-47619] count times out when there are over 10 million records and there is a find query used Created: 17/Apr/20 Updated: 17/Apr/20 Resolved: 17/Apr/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Performance |
| Affects Version/s: | 4.2.5 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Ryan Kaltreider | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
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? |
| Comments |
| Comment by Carl Champain (Inactive) [ 17/Apr/20 ] |
|
Hi ryan.kaltreider@myflavorprint.com, The SERVER project is for bugs and feature suggestions for the MongoDB server. As this ticket does not appear to be a bug, I will now close it. If you need assistance troubleshooting, I encourage you to ask our community by posting on the MongoDB Community Forums or on Stack Overflow with the mongodb tag. |