我正在创建一个索引({ a : 1, b : -1 }),曾经在前台和其他在后台进行。检查总索引大小。前台:82536720 背景:154927024
有人能告诉我为什么会有很大的尺寸差异吗?
Mongo > db.testing.ensureIndex({a:1,b:-1})
Mongo > db.testing.stats()
{
"ns" : "test.testing",
"count" : 2402158,
"size" : 86479836,
"avgObjSize" : 36.00089419596879,
"totalIndexSize" : 160486704,
"indexSizes" : {
"_id_" : 77949984,
"a_1_b_-1" : 82536720
},
}
Mongo > db.testing.dropIndexes()
Mongo > db.testing.ensureIndex({a:1,b:-1},{background : true})
Mongo > db.testing.stats()
{
"count" : 2402158,
"size" : 86479836,
"avgObjSize" : 36.00089419596879,
"totalIndexSize" : 232877008,
"indexSizes" : {
"_id_" : 77949984,
"a_1_b_-1" : 154927024
},
}