Courseiva
Question 1,214 of 1,446

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

A company has a Firestore database in Native mode. They need to run a query that filters on two fields (status and date) and orders by date. The query is slow and returns an error that a matching index is missing. What must the engineer do to resolve this?

⚠ Common exam trap

Google Cloud often tests the misconception that single-field indexes are automatically combined for multi-field queries, or that using 'IN' clauses bypasses indexing requirements, when in fact composite indexes are mandatory for such queries.

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 on status and date in the Firebase Console or using gcloud.

Firestore requires a composite index on both the equality filter field (status) and the order field (date) when a query uses equality filters on one field and an order on another. Without this composite index, the query cannot be executed efficiently and returns an error. Creating the composite index via the Firebase Console or gcloud CLI resolves the issue.

Answer analysis

Option-by-option breakdown

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

  • Enable single-field indexes for both fields; Firestore will automatically use them.

    Why it's wrong here

    Single-field indexes are insufficient for multi-field queries.

  • Rewrite the query using 'IN' clauses to avoid the need for a composite index.

    Why it's wrong here

    Composite indexes may still be needed depending on the query.

  • Create a composite index on status and date in the Firebase Console or using gcloud.

    Why this is correct

    Firestore in Native mode requires a composite index for queries that filter on multiple fields or combine filters with ordering. The index must include both fields.

  • Change the database to Datastore mode, which does not require indexes.

    Why it's wrong here

    Datastore mode also requires composite indexes for similar queries.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.