Courseiva
Indexing and Performance →mediumMultiple Choice

C100DBA Indexing and Performance Practice Question

A 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?

⚠ Common exam trap

The trap here is assuming that the index cannot support the sort because the sort field is not the first field, ignoring the equality condition on the leading field.

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

✓

The index { status: 1, created_at: -1 } should support both the filter and sort; the collection scan indicates a different issue such as index not being built or query planner choosing a different plan.

The compound index { status: 1, created_at: -1 } is designed to support queries that filter on status with equality and sort on created_at. The index prefix (status) is an equality match, allowing the index to be used for both filtering and sorting. A collection scan indicates that the index might not exist, be invalid, or the query planner chose a different plan due to factors like low selectivity or stale statistics.

Answer analysis

Option-by-option breakdown

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

  • ✗

    The index prefix is not equality on the leading field, so the sort cannot be satisfied by the index.

    Why it's wrong here

    The index has status as the leading field and the query includes an equality condition on status, so the prefix is indeed equality. The sort on created_at can be satisfied if the index order matches. Thus this explanation is incorrect.

  • ✓

    The index { status: 1, created_at: -1 } should support both the filter and sort; the collection scan indicates a different issue such as index not being built or query planner choosing a different plan.

    Why this is correct

    With equality on status and a range on created_at, the index can efficiently filter and provide sorted results because the index prefix is equality and the sort field follows. A collection scan suggests the index may be missing, invalid, or the planner selected a less efficient plan due to statistics.

  • ✗

    The index is a partial index that excludes documents with status "active", so it cannot be used.

    Why it's wrong here

    The index definition does not specify a partialFilterExpression, so it is not a partial index. Even if it were, the filter includes status: "active", so it would likely be included. This option mischaracterizes the index type.

  • ✗

    The index does not include the sort field as the first field, so the sort cannot use the index.

    Why it's wrong here

    The sort field is created_at, which is the second field in the index. For a compound index, the sort can be satisfied if the preceding fields are equality conditions. Here status is equality, so the index can support the sort on created_at.

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.