Atlas mongodb collection performance degraded after removing all data

Hello team,
We have Atlas MongoDB cluster M30 General type.
We have 1 very huge collection which was having approximately 200 million documents of storage size 138 GB and Index size 3.7 GB, having 2 indices.
This collection contains non-master data and data can be recalculated.
Due to its increasing size which costs more, we deleted all data from this collection from atlas test database. But still the performance is not good.
We have standalone mongo DB instance for another test environment which is quite faster that above cluster instance. 2000 milliseconds vs 200 milliseconds difference.
What could be reason and how to optimise atlas cluster performance?

Hi team, will deleting collection and recreating will help?

It should since space taken by a collection is not returned as free disk space when documents are deleted. But deleting a collection should delete the files used by the collection.

You might want to take a look at the compact command first. By deleting a collection, the indexes are also deleted and you may forget to recreate an index that was important.

Thanks for confirming.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.