Take the 2-minute tour ×

I have a database that hasn't been compacted in a while so its disk size is much larger than actual data and index sizes. I'll be moving it to another database and would like to know:

  1. would compacting speed up mongodump

  2. does mongorestore rebuild the database in a compact way negating the need to compact

share|improve this question
add comment

1 Answer

  1. Compact + dump should be longer than a single dump since compact in the first run will operate on the same non-compact data.

  2. Yes, it rebuilds the database in a compact way and also releases physical disk space. Simple compact will decrease data size only, but disk space still will be allocated by Mongo (you will not be able to use it for other purposes).

share|improve this answer
add comment

Your Answer


