A Cloud Spanner table accessed only by primary key shows read-latency issues. How should you resolve this?
Choose an answer
Tap an option to check your answer.
Correct answer: Redesign the primary key to avoid monotonically increasing values..
Why this is the answer
Cloud Spanner distributes data across servers based on primary key ranges. If a primary key is monotonically increasing (e.g., a timestamp or an auto-incrementing ID), all new writes will go to the same server, creating a "hotspot" and leading to read and write latency issues. Redesigning the primary key to include a hash component or using a universally unique identifier (UUID) can distribute writes more evenly across servers, resolving the read-latency problem. Removing the profilepicture field might reduce storage but won't address the hotspot issue caused by a monotonic primary key. Adding a secondary index on personid or creating a secondary index using a provided DDL would be beneficial for queries not using the primary key, but it doesn't solve the read-latency problem when accessing the table by primary key due to the underlying hotspot.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed