Courseiva

PCDE Practice Question: Manage a solution that can span multiple database technologies

A developer wants to add a composite index in Firestore to support a query that filters on two fields: 'status' (equality) and 'createdAt' (range). How should the index be configured?

⚠ Common exam trap

The PCDOE exam often tests the misconception that the order of fields in a composite index does not matter, but Firestore strictly requires the equality field to precede the range field to avoid a full collection scan.

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

Create a composite index with fields 'status' (ascending) and 'createdAt' (ascending).

Firestore requires a composite index when a query combines an equality filter on one field with a range filter on another. The index must list the equality field first ('status') followed by the range field ('createdAt'), with ascending order for both to support the range query efficiently. This matches the Firestore index definition rules for composite indexes.

Answer analysis

Option-by-option breakdown

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

  • Create a composite index with fields 'status' (ascending) and 'createdAt' (ascending).

    Why this is correct

    This composite index configuration supports equality on 'status' and range on 'createdAt'.

  • No index is needed; single-field indexes are automatically created.

    Why it's wrong here

    Single-field indexes are automatic, but a composite index is required for queries on multiple fields.

  • Create a composite index with fields 'createdAt' (ascending) and 'status' (ascending).

    Why it's wrong here

    The order must place equality fields first. Reverse order would not support the query efficiently.

  • Add an index exemption on the 'status' field to force index creation.

    Why it's wrong here

    Index exemptions are for excluding specific fields from automatic indexing, not for creating composite indexes.

About these practice questions

One of 1,446 original PCDE practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PCDE practice question is part of Courseiva's free Google Cloud 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 PCDE exam.