← Quay lại

Câu 194 · Professional Cloud Database Engineer

Câu 194

Professional Cloud Database Engineer

Your Cloud SQL for PostgreSQL database supporting a financial application has been experiencing “deadlock detected” errors during end-of-month processing. You notice that CPU utilization spikes to 90% during these periods, and several long-running queries are consuming significant resources. You need to identify the specific queries causing the deadlocks and implement monitoring to solve similar issues before they cause application failures.

What should you do?
  1. A. Use Cloud SQL System Insights to identify long-running queries and number of deadlocks that occurred in the database. Enable a log_lock_waits flag to determine if lock waits are causing poor performance. Set up Cloud Monitoring alerts for higher CPU utilization and connection count.
  2. B. Optimize SQL queries by adding appropriate indexes to frequently accessed columns and rewriting complex joins to use LEFT JOIN instead of INNER JOIN, where applicable.
  3. C. Implement connection pooling at the application layer to reduce the number of direct database connections and optimize shared_buffers and work_mem parameters in Cloud SQL for PostgreSQL to improve query execution efficiency.
  4. D. Increase the deadlock_timeout parameter on the Cloud SQL for PostgreSQL instance. Export logs to Cloud Logging, and create log-based metrics to track deadlock occurrences.

Làm câu này trên web →