
Answer-first summary for fast verification
Answer: Change the primary key to not have monotonically increasing values.
The correct answer is C. Cloud Spanner can experience issues with what is known as 'hotspotting,' which occurs when a large portion of read or write operations are concentrated on a specific part of the database. The sequential nature of the person_id as a primary key can lead to hotspotting because new records are continually added at the 'end' of the key space, creating a hot node which can cause performance bottlenecks. To mitigate this, you should choose a primary key that distributes writes more evenly across the key space. This could be achieved by using a primary key that does not have monotonically increasing values.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Your customer has deployed a solution utilizing Cloud Spanner, and they have observed performance issues related to read latency on a specific table. This table is exclusively accessed by users through a primary key. Below is the table schema. To address this performance issue, what steps should you take?
A
Remove the profile_picture field from the table.
B
Add a secondary index on the person_id column.
C
Change the primary key to not have monotonically increasing values.
D
Create a secondary index using the following Data Definition Language (DDL):
No comments yet.