Collection Select * very slow

Hello, One of the select * from collection in TEST and DEV is taking very long to run while it is running in milliseconds on prod. Can you please let me know what it could be? There is only one index and I reindexed and I cleared cache too. All other collections are fine and super fast. What should I do?

Hi @Ana,

Welcome to the MongoDB Community forums :sparkles:

Just for clarification,

do you mean:

db.collection.find({});

Would it be possible for you to be more specific in numbers, such as how much difference is being observed in time between the production environment and the test environment?

There could be a few possible reasons behind that but we will be able to narrow it down once we have more specific details.

It would be helpful if you shared a sample dataset and the indexing of the field or sub-field with us so that we could get a reference. Additionally, could you provide the .explain(“executionStats”) output from each environment?

Thanks,
Kushagra

1 Like