Google Professional Cloud Database Engineer Question 132
Select 3Google Cloud PlatformYou are managing a Cloud SQL instance running PostgreSQL for a production workload. Users have reported degraded performance, and you suspect database resource contention. Which steps should you take to investigate and identify the root cause?
- A
Use the Cloud SQL Query Insights feature to analyze query performance and identify slow-running queries.
- B
Enable query logging to review all queries executed in the database and identify problematic ones.
- C
Review CPU and memory utilization metrics in the Cloud Monitoring dashboard.
- D
Increase the instance size to reduce contention without further investigation.
- E
Check for locks or long-running transactions using the PostgreSQL
pg_stat_activitysystem view.
Show answer and explanation
Correct answers: A, C, E
Explanation
Investigating database resource contention requires a systematic approach to isolate and identify the root cause. Using tools like Query Insights and pg_stat_activity allows you to focus on specific queries or transactions causing contention. Additionally, reviewing instance resource metrics like CPU and memory usage in Cloud Monitoring can confirm whether resource limits are being reached. Simply scaling up the instance without understanding the issue may mask the problem and lead to higher costs.
- A. Correct.
Query Insights provides detailed information about query performance, including execution times and resource consumption, making it a valuable tool for identifying slow or resource-intensive queries.
- B. Incorrect.
While query logging can provide insight into executed queries, enabling it in a production environment without caution can introduce overhead and potentially worsen performance.
- C. Correct.
CPU and memory utilization metrics in Cloud Monitoring can help identify whether the instance is under heavy load, pointing to resource contention.
- D. Incorrect.
Increasing the instance size without identifying the root cause may temporarily alleviate the issue but does not address the underlying problem, and it may lead to unnecessary costs.
- E. Correct.
The
pg_stat_activitysystem view in PostgreSQL provides information about active queries, transactions, and locks, which can help identify blocking or long-running processes contributing to contention.