Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is meant by filesize and datasize in MongoDB?

Tags:

mongodb

I am started using MongoDB few days ago, and i have problem in understanding some database architecture. If i execute the query db.stats(); i had got filesize ,datasize,storagesize & indexsize. While i am surfing i found that the following:

Storagesize = datasize + free space allocated for collection

datasize = database size utilised by MongoDB

Here, I could not understand the representaion of filesize & datasize reprsentation. For datasize --> indexsize is also included?. Please provide a precise solution for the specified attributes and please do correct me if i mentioned anythng wrong.

Advance Thanks,

like image 529
user626206 Avatar asked Dec 09 '11 14:12

user626206


1 Answers

  • dataSize : Sum of all actual data (BSON objects) used by the database, in bytes
  • indexSize : Sum of all indexes used by the database, in bytes
  • storageSize : dataSize plus all preallocated collection space, in bytes
  • fileSize : Sum of the sizes of all files allocated for this database (e.g. test.0 + test.1 etc.), in bytes
  • nsSizeMB : Size of namespace file for this database, in megabytes.
  • avgObjSize : Average size of document objects in database. This value includes padding and may therefore not change when you reduce the size of documents.
like image 132
Remon van Vliet Avatar answered Oct 21 '22 09:10

Remon van Vliet