C100DBA Indexing and Performance Practice Question
When evaluating the performance of a 'hint' in MongoDB, what should you keep in mind?
⚠ Common exam trap
Test-takers frequently think hints permanently improve performance by hardcoding the best execution path, ignoring the fact that database workloads and data distributions change over time.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Hints prevent the optimizer from adapting.
Using a hint forces the optimizer to use a specific index, ignoring its own cost-based selection. While this can sometimes be useful for troubleshooting or very specific cases where the optimizer makes a poor choice, it is generally discouraged because it prevents the database from adapting to data changes. As the data distribution evolves, a hinted index might become suboptimal, leading to degraded performance compared to a dynamic plan.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Hints are always faster than the optimizer's choice.
Why it's wrong here
The optimizer is designed to calculate the most efficient path based on statistics. Forcing an index via a hint often leads to slower queries if the data changes and the index is no longer the most efficient option for the new distribution, resulting in suboptimal performance.
- ✗
Hints should be used for all production queries.
Why it's wrong here
Using hints for all production queries is a significant anti-pattern. It makes the application rigid and prevents MongoDB from automatically optimizing query execution as data grows or schema changes. It creates a maintenance nightmare, as every index modification would require updating all the hardcoded query hints.
- ✓
Hints prevent the optimizer from adapting.
Why this is correct
A hint overrides the query optimizer, forcing it to use a specific index regardless of cost. This prevents the system from choosing better plans as the data distribution changes. This can result in performance regression as the application scales and the original index choice is no longer optimal.
- ✗
Hints are only available for aggregation queries.
Why it's wrong here
Hints can be applied to both simple find() queries and complex aggregation pipelines. They are a universal tool for forcing execution plans across different query types, although they should be used sparingly and only after careful cost-benefit analysis and thorough testing in a production-like environment.
About these practice questions
This C100DBA question is part of Courseiva's 222-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official MongoDB exam blueprint
This C100DBA practice question is part of Courseiva's free MongoDB certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the C100DBA exam.