As a part of load testing I have many collections and indexes always created in Mongodb. After processing results, I also have to drop these collections.
What I notice is when I drop collections the DB locks are immense and it effects all queries that happen in that time! I am currently on 3.4 (newer version I may move later, but not immediate)
So I was thinking about this approach please let me know if this works
1> Drop collection : and bear the locks
2> Drop indexes and then drop collection : this definitely shows “lesser” acquiring locks but occasionally introduce global locks
3> Delete MANY (all data inside collection) and then drop collection?
Since the data is deleted, will drop collection will have less work to do? Will deleteMany have any impact though?