PretendoNetwork / miiverse-api

Pretendo Network's Miiverse service
GNU Affero General Public License v3.0
65 stars 11 forks source link

[Enhancement]: Use indexes for Mongo collections #37

Open jonbarrow opened 5 months ago

jonbarrow commented 5 months ago

Checked Existing

What enhancement would you like to see?

When a collection has no indexes, Mongo will perform a full COLLSCAN on the collection, scanning all documents to perform the query. This can very easily eat all available resources when working with

When there are many documents, and many scans of those documents, Mongo can easily max out CPU usage and remain there. When working with very large documents (such as those which contain files), this can also easily max out memory usage.

Any other details to share? (OPTIONAL)

No response