Courseiva
Application Administration →mediumMultiple Choice

C100DBA Application Administration Practice Question

An application uses a compound index on `{ 'status': 1, 'priority': -1 }`. Which query will efficiently use this index?

⚠ Common exam trap

Candidates often think an index on fields B and C can be used when querying only field C, ignoring the strict left-to-right prefix rule of compound indexes.

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

✓

db.tasks.find({ 'status': 'open' })

Compound indexes are ordered. A query will only use the index if the query filter matches the prefix of the indexed fields. Here, the index starts with 'status'. Therefore, queries filtering on 'status' and optionally 'priority' will be efficient. Understanding index prefixing is crucial for DBAs to ensure that developers write efficient queries that fully leverage the index structures, avoiding unnecessary collection scans and keeping performance stable as the data grows.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    db.tasks.find({ 'priority': 5 })

    Why it's wrong here

    The index starts with the 'status' field, not the 'priority' field. Because the query does not include the first field in the index, it cannot effectively use this index. This would result in an inefficient collection scan, which is suboptimal for application performance in production environments.

  • ✓

    db.tasks.find({ 'status': 'open' })

    Why this is correct

    Since the query filters by the leading field in the compound index ('status'), it can perform an index scan. This allows the database to quickly narrow down the result set without scanning every document in the collection, leading to significantly better performance for the application's read operations.

  • ✗

    db.tasks.find({ 'created': '2023-01-01' })

    Why it's wrong here

    The query filters on the 'created' field, which is not part of the compound index. Consequently, the index provides no benefit to this query. This will force a full collection scan, which is detrimental to the database's performance and should be avoided in production by creating appropriate indexes.

  • ✗

    db.tasks.find({ 'status': 'open', 'type': 'urgent' })

    Why it's wrong here

    While the query uses the 'status' field, the inclusion of the 'type' field that is not part of the index limits the efficiency. Although it can use the index to filter by status, it still has to perform additional work to filter the 'type' field, making it less than optimal.

About these practice questions

Courseiva writes every C100DBA question from scratch — 222 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.