Consider a collection students that has been sharded using the following key: { "year": 1 } The possible values for the year field are 14, 15, 16, 17. Which of the following problems may arise after sharding on the year field? Check all that apply:
题目选项
- A.Creation of indivisible jumbo chunks.
- B.Out-of-memory errors on the size of the shard key index.
- C.Reduced number of targeted queries.
答案置信度:高
正确答案:A、C
解析语言:中文
year 只有 14~17 四个取值,基数极低:同一分片键值的文档无法被拆到两个 chunk,一旦某个年份的数据超过 chunk 上限就形成不可分裂的 jumbo chunk,各分片数据量也严重不均(A)。同时 chunk 数量上限仅 4 个,除恰好带 year 等值条件的查询外,绝大多数查询无法定位 chunk、只能广播,可定向查询的比例与收益都下降(C);B 与"分片键索引占内存"无关。