You must read explain() output and design compound indexes with equality fields before range fields, matching the query shape. The single most important thing is getting compound index field order right, since it determines whether MongoDB can bound the scan or must examine every candidate document.
Start practicing
Indexing and Performance — choose a session length
Free · No account required
Domain overview
This domain covers MongoDB index selection, compound index field order, index intersection, and the performance cost of over-indexing. Questions present real query patterns and sharded-cluster behavior, asking you to pick the most efficient index or explain why a plan scans more shards or documents than expected.
Exam objectives
Choosing compound index field order for equality-then-range query predicates
Using explain() to read winning plans, IXSCAN, COLLSCAN, and rejected plans
Diagnosing scatter-gather when a query does not target the shard key
Recognizing index write overhead, working set growth, and low-selectivity fields
Reversing compound index order so the range field precedes the equality field, forcing a less selective scan.
Assuming any shard key filter avoids scatter-gather when the query lacks the full shard key prefix.
Adding indexes for every queried field, ignoring write amplification and RAM pressure on the working set.
Click any question to see the full explanation and answer options, or start a focused practice session above.
An application frequently queries a large collection using two fields: 'category' (equality) and 'timestamp' (range). Which index strategy provides the most efficient execution plan?
2Which property of a field makes it a poor candidate for an index?
3When would you choose to create a Partial Index instead of a standard index?
4Refer to the exhibit. A developer attempts to run a query using both 'tags' and 'location' in a single $and operation. What is the expected behavior regarding index usage?
5Refer to the exhibit. Which index is most effective for this query?
6What is the primary benefit of using a Covered Query in MongoDB?
7Why should you avoid creating too many indexes on a single collection?
8When evaluating the performance of a 'hint' in MongoDB, what should you keep in mind?
9Which TWO of the following scenarios are best handled by a Hashed Index?
10What is the consequence of having a high number of 'keysExamined' compared to 'nReturned' in a query?
11An e-commerce application frequently runs a query filtering by category and sorting by price descending. Which index structure provides the optimal performance for this access pattern?
12An operations engineer notices that a frequently executed aggregation pipeline fails with a 'Exceeded memory limit for $sort' error. Which index configuration best resolves this memory constraint?
13Refer to the exhibit. An application queries active user documents frequently, but explainPlan output reveals a COLLSCAN stage. What is the most appropriate remediation step?
14A sharded cluster experiences poor query performance because a targeted query targeting a specific shard key still results in a scatter-gather operation across all shards. What is the root cause?
15Refer to the exhibit. The explain output shows a SORT stage wrapping an IXSCAN stage. What is the performance implication of this execution plan?
16An application frequently queries a large collection by 'user_id' and 'status', sorting the results by 'timestamp'. Which index provides the most efficient execution plan?
17Refer to the exhibit. What does this output indicate about the query performance?
18Which situation is best suited for a Multikey Index?
19When evaluating index performance, what is the impact of a 'partial index'?
20A MongoDB DBA observes that a query with filter { status: "active", created_at: { $gte: ISODate("2024-01-01") } } and sort { created_at: -1 } is performing a collection scan. The collection has an index { status: 1, created_at: -1 }. Which of the following best explains why the index is not being used efficiently?
21A DBA is designing indexes for a collection that stores user activity logs. The collection has fields: user_id, action, timestamp, and metadata (an embedded document). The most common queries are: (1) find all actions for a given user_id sorted by timestamp descending; (2) find all users who performed a specific action within a time range. Which TWO indexes would best support these queries? (Choose two.)
22A collection 'events' has a compound index { tenantId: 1, createdAt: -1 }. A developer runs db.events.find({ tenantId: "acme", createdAt: { $gte: ISODate("2024-01-01") } }).sort({ createdAt: -1 }).limit(50). The explain output shows the index is used but the query still performs a large in-memory sort. Which action resolves the sort performance issue?
23A DBA needs to optimize a query that filters on a field with high cardinality, such as email, and also sorts on a low cardinality field, such as country. The query is { email: "user@example.com" } with sort { country: 1 }. Which index would best support this query?
24A DBA is troubleshooting a slow query on a large collection. Which two techniques directly reduce the number of documents the query must examine for an equality-plus-range predicate? (Choose two.)
25A DBA needs a query that returns only the fields name and email from a 'users' collection, filtered by an equality on email, to avoid fetching full documents from disk. Which index design supports this efficiently?
26A collection 'logs' receives continuous inserts and is queried by both timestamp ranges and a rarely used severity field. A DBA creates six indexes to cover every query variant, and now insert throughput has dropped sharply while index sizes dominate the working set. Which action best restores insert throughput while preserving the important query paths?
27A DBA notices that a query on the products collection uses an index scan but returns only a small fraction of documents. The index is { category: 1, price: 1 }. The query filters on category and price with a range condition on price. Which statement best describes why the index might still be efficient despite scanning many index entries?
28A support team reports that a MongoDB 6.0 replica set is experiencing slow queries on a collection where almost every document has a unique value for the field status. A developer suggests creating a hashed index on status to speed up equality lookups. Which outcome should the DBA expect?
29A DBA is reviewing a query that performs a sort on a field named score in descending order. The collection has an index { score: 1 }. The query also includes a filter on a field named active with an equality condition. The DBA observes that the query planner chooses a collection scan and performs an in-memory sort. Which index would allow the query to use an index for both the filter and the sort?
30A DBA observes that a query with filter { a: 5, b: { $gt: 10 } } and sort { c: 1 } is using a collection scan despite the existence of an index { a: 1, b: 1, c: 1 }. The DBA wants to improve performance. Which action is most likely to allow the index to support both the filter and the sort?
You must read explain() output and design compound indexes with equality fields before range fields, matching the query shape. The single most important thing is getting compound index field order right, since it determines whether MongoDB can bound the scan or must examine every candidate document.
The Courseiva C100DBA question bank contains 30 questions in the Indexing and Performance domain. Click any question to see the full explanation and answer breakdown.
Start with a 10-question focused session to identify your baseline accuracy in this domain. Read every explanation — even for questions you answer correctly — to understand the reasoning. Once you score consistently above 80%, move to a 20–30 question session to confirm depth before moving to the next domain.
Yes — the session launcher on this page draws questions exclusively from the Indexing and Performance domain. Choose 10, 20, 30, or 50 questions for a focused session, or click individual questions to review them one by one.
Save your results, see per-domain analytics, and get readiness scores — free, for every certification.
Sign Up FreeFree forever · Every certification included