MongoDB DBA · Question 501 · Multiple choice

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:

Answer options

  1. A.
    Inserts
  2. B.
    Finds with Sort
  3. C.
    Bulk Delete

Answer confidence: High

Correct answer: A, C

Explanation language: Chinese

增加索引后每次写操作都要同步维护索引:插入文档时必须为每个相关索引插入键,所以 Inserts 变慢;删除文档时也必须从所有索引中删除对应键,批量删除尤其明显。C(带排序的查找)恰恰是索引的受益者,索引可以同时提供过滤条件和排序顺序、避免内存排序,因此不会变慢。

Papers containing this question

This question appears in 1 bank records. Public pages combine identical prompts and options. Selected questions display the highest-confidence record; the others show a short preview. Paper-based learning preserves each record's answer, explanation, and confidence.

AUTHOR · PROJECTS · OPEN SOURCE

Author & MongoDB projects

Building data platforms, MongoDB migration and sync tools, and cloud operations products.

Contact the author for any MongoDB needs.

Contact the author ↗mlhp123@outlook.com

Support the author

If this question bank helps you, optional donations are welcome.

Scan with Alipay to support the authorOpen full-size donation image ↗