Google Professional Cloud Database Engineer Question 192
Select 2Google Cloud PlatformYou are managing a MySQL database hosted on Google Cloud SQL. Recently, your team has noticed degraded performance during peak hours. A review of the database shows that the size of your indexes has grown significantly over time. To address this, you decide to perform database maintenance. Which actions should you take to optimize the database performance?
- A
Rebuild the indexes to reduce fragmentation.
- B
Increase the database instance's CPU and memory resources.
- C
Analyze the slow query log to identify inefficient queries.
- D
Enable automatic backups to ensure data integrity.
- E
Set up a scheduled vacuum operation to reclaim unused space.
Show answer and explanation
Correct answers: A, C
Explanation
To address performance degradation caused by growing index size and query inefficiencies, it is crucial to rebuild indexes to reduce fragmentation and analyze the slow query log to optimize database queries. These maintenance actions directly target the root causes of the issue and help improve database performance.
- A. Correct.
Rebuilding the indexes reduces fragmentation, which can improve query performance, especially for large or frequently updated tables. This is a critical maintenance task.
- B. Incorrect.
Increasing CPU and memory resources might temporarily mask performance issues but does not address the root cause of degraded performance due to index size and fragmentation.
- C. Correct.
Analyzing the slow query log is an essential maintenance task to identify and optimize inefficient queries, which can reduce the load on the database and improve performance.
- D. Incorrect.
Enabling automatic backups is a best practice for data protection but does not directly address performance degradation caused by index size or query inefficiency.
- E. Incorrect.
Vacuum operations are specific to databases like PostgreSQL and are not applicable to MySQL. This option is irrelevant in this scenario.