What is difference between “size” and “storageSize” displayed by Mongo stats() function

前端 未结 1 1048

What is difference between \"size\" and \"storageSize\" displayed by Mongo stats() function? Which one shows the actual size on disk for a particular collection

1条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-11 18:55

    in simple words:

    • size refers for logical allocation (this is seen by database engine)
    • storageSize refers for physical file space allocation

    As WT (WiredTiger) is used, with enabled data compression, then physical allocation is smaller because of compression

    db.collection.storageSize

    db.collection.stats

    0 讨论(0)
提交回复
热议问题