PDE Storing the Data Practice Question
A team is designing a Spanner database for a global inventory system. They need to optimize query performance for frequently joined tables. Which THREE design decisions help achieve this? (Choose 3.)
⚠ Common exam trap
Google often tests the misconception that avoiding joins entirely (Option D) is a better optimization than properly using Spanner's native features like interleaving and secondary indexes, which are designed to handle joins efficiently at scale.
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
✓
Design primary keys to distribute write load evenly across splits.
Option B is correct because Spanner scales by splitting data into ranges, and a monotonically increasing or skewed primary key concentrates writes on a single split; designing keys (for example, using hash prefixes or reversed timestamps) to distribute writes evenly avoids hotspots and keeps join-driving lookups performant. Option C is correct because interleaved tables physically co-locate child rows with their parent row in the same split, so joins between parent and child on the interleaved key prefix are executed locally without network shuffling, dramatically improving join performance. Option E is correct because secondary indexes let Spanner satisfy WHERE-clause predicates by index scan rather than full table scan, reducing the rows read before the join and thus lowering latency and cost. Option A is not appropriate because Cloud SQL is a regional, non-horizontally-scalable relational service and does not provide Spanner's global distribution, external consistency, or interleaving; joins are fully supported in Spanner. Option D is not appropriate because collapsing everything into a single table with JSON columns discards Spanner's relational join and interleaving capabilities, prevents effective secondary indexing on nested fields, and typically worsens performance and schema maintainability.
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 Cloud SQL instead if joins are needed.
Why it's wrong here
Cloud SQL does not provide Spanner's globally distributed, externally consistent storage, so it cannot host the inventory workload at all. It is tempting because Cloud SQL supports joins natively, but the stem requires Spanner's horizontal scale and multi-region consistency, which Cloud SQL cannot deliver.
- ✓
Design primary keys to distribute write load evenly across splits.
Why this is correct
Evenly distributed primary keys prevent hotspots by spreading writes across splits, avoiding a single split becoming a bottleneck. This keeps load balanced across nodes, so frequently joined tables are not throttled by one overloaded split during concurrent inventory updates.
- ✓
Use interleaved tables to co-locate related rows.
Why this is correct
Interleaved tables physically co-locate child rows with their parent key, so joins between them become local prefix reads rather than distributed lookups. This removes network hops for related inventory rows, which is precisely the join-performance optimisation the scenario requires.
- ✗
Store all data in a single table with JSON columns to avoid joins.
Why it's wrong here
Collapsing tables into JSON columns removes the relational schema Spanner indexes and optimises, forcing full-row scans instead of index-backed joins. It is tempting because denormalisation reduces join count, but Spanner's interleaved tables and secondary indexes are the intended mechanism for join performance.
- ✓
Create secondary indexes on columns used in WHERE clauses.
Why this is correct
Secondary indexes let Spanner satisfy WHERE predicates by index scan rather than full table scan, reducing rows read before joins execute. This directly accelerates the filtered lookups the inventory queries rely on, lowering latency for frequently joined tables.
Go deeper
Related to this question
About these practice questions
This PDE question is part of Courseiva's 747-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 PDE 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 PDE exam.