Manage a solution that can span multiple database technologies →mediumMultiple ChoiceObjective-mapped
PCDE Practice Question: Manage a solution that can span multiple database technologies
A company uses Firestore in Datastore mode. They need to create a composite index for a query that filters on two properties. The query is already running and returning an error that an index is required. What is the correct way to create this index?
⚠ Common exam trap
Google often tests the misconception that Datastore mode automatically creates composite indexes from query patterns, similar to Firestore Native mode's automatic index creation, but in Datastore mode, composite indexes must be manually defined.
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 the index using the gcloud datastore indexes create command with a YAML file.
In Firestore (Datastore mode), composite indexes must be explicitly created before they can be used by queries that filter on multiple properties. The `gcloud datastore indexes create` command with a YAML file is the standard method to define and deploy these indexes, as the Datastore mode does not automatically create composite indexes from query patterns.
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 the index using the gcloud datastore indexes create command with a YAML file.
Why this is correct
Composite indexes are manually defined via a YAML file and created with gcloud.
- ✗
Modify the query to use a single filter to avoid needing a composite index.
Why it's wrong here
This may not meet requirements and avoids the real solution.
- ✗
Enable the 'auto-index' feature in the Datastore console.
Why it's wrong here
There is no such feature; composite indexes must be manual.
- ✗
The index will be created automatically based on the query pattern.
Why it's wrong here
Automatic index creation only applies to single-field indexes.
Go deeper
Related to this question
About these practice questions
This PCDE question is part of Courseiva's 1,446-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
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.