-
Type: Question
-
Resolution: Done
-
Priority: Minor - P4
-
None
-
Affects Version/s: 2.0.3
-
Component/s: Storage
-
None
We are trying to estimate the storage size for a given schema ..
On creating just a single document in a collection with only one attribute of type long results in avgObjSize of 36 bytes. What is the break up for this 36?
PRIMARY> db.test64Long.stats()
{
"ns" : "quad.test64Long",
"count" : 1,
"size" : 36,
"avgObjSize" : 36,
"storageSize" : 4096,
"numExtents" : 1,
"nindexes" : 1,
"lastExtentSize" : 4096,
"paddingFactor" : 1,
"flags" : 1,
"totalIndexSize" : 8176,
"indexSizes" :
,
}
PRIMARY> db.test64Long.findOne();
On creating a document with int, the avgObjSize is 32 bytes.
PRIMARY> db.testInt.stats();
{
"ns" : "quad.testInt",
"count" : 1,
"size" : 32,
"avgObjSize" : 32,
"storageSize" : 4096,
"numExtents" : 1,
"nindexes" : 1,
"lastExtentSize" : 4096,
"paddingFactor" : 1,
"flags" : 1,
"totalIndexSize" : 8176,
"indexSizes" :
,
"ok" : 1
}
PRIMARY> db.testInt.findOne();
On creating a document with an array of just one element of type long, the avgObjSize 44. What is the break up for 44 bytes.
PRIMARY> db.testAr2.findOne();
PRIMARY> db.testAr2.stats();
{
"ns" : "quad.testAr2",
"count" : 1,
"size" : 44,
"avgObjSize" : 44,
"storageSize" : 4096,
"numExtents" : 1,
"nindexes" : 1,
"lastExtentSize" : 4096,
"paddingFactor" : 1,
"flags" : 1,
"totalIndexSize" : 8176,
"indexSizes" :
,
"ok" : 1
}