-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: 2.0.1
-
Component/s: None
-
None
-
Environment:3 mongo production cluster on Unbuntu 10.10 cloud machines
-
Linux
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
I recently transitioned a collection (> 30MM documents) from long, human readable key names to short, 1 character keys to save on storage space (on disk and in memory) & improve performance.
I dropped the old indexes, ran a big db.mycollection.update(
{...}), compacted the collection (on primary and 2 replicas) then built new indexes.
The storageSize and totalIndexSize were cut in half (about what I expected). But avgObjSize hasn't change significantly for that collection! I've also noticed that paddingFactor is significantly different on each server (1.01, 1.49 on replicas, 1.36 on primary).
Why wouldn't the avgObjSize drop by about half?
---BEFORE---
PRIMARY> db.broadcasts.stats()
{
"ns" : "redacted.broadcasts",
"count" : 32370008,
"size" : 91792986284,
"avgObjSize" : 2835.7418473297876,
"storageSize" : 91835727232,
"numExtents" : 43,
"nindexes" : 5,
"lastExtentSize" : 2146426864,
"paddingFactor" : 1.5799999997279606,
"flags" : 1,
"totalIndexSize" : 9271265136,
"indexSizes" :
,
"ok" : 1
}
---AFTER---
PRIMARY> db.broadcasts.stats()
{
"ns" : "redacted.broadcasts",
"count" : 32370008,
"size" : 91792986284,
"avgObjSize" : 2835.7418473297876,
"storageSize" : 49060732592,
"numExtents" : 23,
"nindexes" : 4,
"lastExtentSize" : 2146426864,
"paddingFactor" : 1.00999999972796,
"flags" : 1,
"totalIndexSize" : 4578404656,
"indexSizes" :
,
"ok" : 1
}