'MongoDB unique index size more than document total size
I am using MongoDB Atlas.
I recently found out that the total size of one of my collection is 67.75 mb, but one of its unique index is taking 294 mb, how is this even possible? How can the index size be more than double of the total document size?
Please take a look into the screenshot below
Solution 1:[1]
What you see in the picture as 67.75MB is actually the storageSize which is usually the compressed size of your collection (db.myCollection.stats(1024*1024).storageSize ) , to view your actual collection size in MB you can execute:
db.myCollection.stats(1024*1024).size
This will show your collection uncompressed size which is expected to be much more then only 67.75MB ...
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | R2D2 |
