- 索引的统计信息存放在数据节点 SYSSTAT.SYSINDEXSTAT 集合中,具体字段如下:
字段名 | 数据类型 | 默认值 | 必须 | 说明 |
---|---|---|---|---|
CollectionSpace | String | 是 | 统计收集的集合空间名 | |
Collection | String | 是 | 统计收集的集合名 | |
CreateTime | NumberLong | 0 | 是 | 统计收集的时间戳 |
Index | String | 是 | 统计收集的索引名 | |
IndexLevels | NumberInt | 1 | 是 | 统计收集时索引的层数 |
IndexPages | NumberInt | 1 | 是 | 统计收集时索引页的个数 |
IsUnique | BOOL | FALSE | 是 | 统计收集的索引是否唯一索引 |
KeyPattern | BSONObj | 是 | 统计收集的索引字段定义,如:{a:1} | |
SampleRecords | NumberLong | 0 | 是 | 统计收集时抽样的文档个数 |
TotalRecords | NumberLong | 10 | 是 | 统计收集时的文档个数 |
MCV | Object | 否 | 频繁数值集合(Most Common Values),如: MCV: { Values: [ {a:1}, {a:2}, ... ], Frac: [ 50, 50, ... ] } |
|
MCV.Values | Array | 否 | 频繁数值中的值 | |
MCV.Frac | Array | 否 | 频繁数值的比例,每个值的取值 0 ~ 10000,最终比例为 (Frac / 10000) * 100% |
- SYSSTAT.SYSINDEXSTAT 统计信息示例:
{
"Collection": "sample",
"CollectionSpace": "employee",
"CreateTime": 1496910926035,
"Index": "index",
"IndexLevels": 2,
"IndexPages": 256,
"IsUnique": false,
"KeyPattern": {
"a": 1
},
"MCV": {
"Values": [
{
"a": 2358
},
{
"a": 7074
},
{
"a": 11790
},
...
],
"Frac": [
50,
50,
50,
...
]
},
"SampleRecords": 200,
"TotalRecords": 600000
}
更多信息请访问巨杉数据库官网