I recently reindexed a collection in my MongoDB Atlas cluster. The index size dropped significantly — from ~35 GB down to ~11 GB (a reduction of more than 20 GB). However, the logicalDataSize metric reported by the system remains around 60 GB, both before and after the reindexing.
My questions are:
- Why doesn’t the
logicalDataSizedecrease when index size is reduced? - What is the relationship between:
logicalDataSize(Atlas metric)storageSize(on-disk size reported bydb.stats()/ WiredTiger)- index sizes (as reported by
db.collection.stats())
- Does reindexing only compact index files without impacting the logical data size metric?
- Are there any operations (e.g.,
compact,repairDatabase, or automated Atlas maintenance) that would reclaim disk space and actually reduce the reported data size?
Any insights into how MongoDB Atlas tracks data vs. index size would be greatly appreciated.