How can MongoDB dataSize be larger than storageSize?

前端 未结 2 1135
渐次进展
渐次进展 2021-01-02 01:08

As far as I understand, the storage size for MongoDB should always be larger than data size. However, after upgrading to Mongo 3.0 and using WiredTiger, I start seeing that

2条回答
  •  醉酒成梦
    2021-01-02 01:30

    The storageSize metric is equal to the size (in bytes) of all the data extents in the database. Without compression, this number is larger than dataSize because it includes yet-unused space (in data extents) and space vacated by deleted or moved documents within extents. However, as you are using the WiredTiger storage engine, data is compressed on the disk and is therefore smaller than the dataSize.

提交回复
热议问题