18. Indexes are created to optimize the execution of certain operations, but they can also worsen the performance of other operations. Assuming all your indexes fit into RAM, which of the following operations might experience worse performance after adding indexes to your collection? Check all that apply:
题目选项
- A.Inserts
- B.Finds with Sort
- C.Bulk Delete
答案置信度:高
正确答案:A、C
解析语言:中文
增加索引后每次写操作都要同步维护索引:插入文档时必须为每个相关索引插入键,所以 Inserts 变慢;删除文档时也必须从所有索引中删除对应键,批量删除尤其明显。C(带排序的查找)恰恰是索引的受益者,索引可以同时提供过滤条件和排序顺序、避免内存排序,因此不会变慢。