Courseiva

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

A Cloud Firestore database in Native mode is used for a mobile app. The app queries a collection with a composite filter on two fields. Queries are slow and the app shows an error that an index is required. What should the developer do?

⚠ Common exam trap

Google often tests the misconception that Firestore automatically creates all necessary indexes, but in reality, only single-field indexes are auto-created; composite indexes must be manually defined by the developer.

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 in the Firebase Console or gcloud CLI.

Cloud Firestore requires an index to support composite filters (queries filtering on multiple fields). When a query uses a composite filter and no matching index exists, Firestore returns an error indicating an index is required. The correct solution is to create the necessary composite index manually via the Firebase Console or the gcloud CLI, as Firestore does not automatically create composite indexes for queries with equality and range filters on different fields.

Answer analysis

Option-by-option breakdown

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

  • Use a database export and import to regenerate indexes.

    Why it's wrong here

    Export/import does not create missing composite indexes.

  • Create a composite index in the Firebase Console or gcloud CLI.

    Why this is correct

    Composite indexes are manually created and are required for multi-field queries.

  • Restructure the data to use a single field for the filter.

    Why it's wrong here

    This may not be practical and doesn't address the error.

  • Enable the automatic index creation in the Firestore settings.

    Why it's wrong here

    Automatic index creation only applies to single-field indexes.

About these practice questions

Courseiva writes every PCDE question from scratch — 1,446 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 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.