从集合中删除许多记录后,为什么索引大小增加了?

时间:2018-09-04 13:24:26

标签: mongodb

今天我从一个集合中删除了许多记录,起初总数为1379345,删除的计数为925367,然后剩余的计数为453978。

删除之前:

"count" : 1379345,
"size" : 3823247286,
"avgObjSize" : 2771,
"storageSize" : 1871536128,
"nindexes" : 4,
"totalIndexSize" : 86913024,
"indexSizes" : {
    "_id_" : 12873728,
    "created_at_1" : 17534976,
    "storage_time_1" : 7397376,
    "guid_1" : 49106944
},

删除后:

"count" : 453978,
"size" : 2478837459,
"avgObjSize" : 5460,
"storageSize" : 1871536128,
"nindexes" : 4,
"totalIndexSize" : 89522176,
"indexSizes" : {
    "_id_" : 12873728,
    "created_at_1" : 18096128,
    "storage_time_1" : 7397376,
    "guid_1" : 51154944
},

count: 1379345 ==> 453978 diff: 925367
size: 3823247286 ==> 2478837459 diff: 1,344,409,827
totalIndexSize: 86913024 ==> 89522176 diff: -2,609,152

现在我有些困惑,为什么totalIndexSize增加而不减少?我认为它应该像size一样缩小吗?

0 个答案:

没有答案