Google Cloud Professional Cloud Database Engineer — Question 139

You are migrating an on-premises database to Spanner. There are a few tables, each with a few hundred records that do not have a primary key on the source database. You need to migrate all of the tables over to the news database while avoiding hot-spotting issues. What should you do?

Answer options

Correct answer: B

Explanation

The correct answer is B because using the GENERATE_UUID() function ensures that each record has a unique identifier, which helps in preventing hot-spotting during the migration. Option A is incorrect as setting a primary key later may lead to issues with data consistency and hot-spotting. Option C is not ideal as it does not address the absence of unique identifiers, and option D would maintain the existing inconsistency by not introducing primary keys.