Ensure that the "log_planner_stats" database flag is disabled for your Google Cloud PostgreSQL database instances in order to avoid performance issues caused by excessive logging. The "log_planner_stats" flag controls the inclusion of PostgreSQL planner performance statistics in the PostgreSQL logs for each query.
This rule resolution is part of the Conformity Security & Compliance tool for GCP.
efficiency
excellence
Even though logging PostgreSQL planner performance statistics can be useful for certain troubleshooting scenarios, it may significantly increase the amount of logs and cause performance overhead.
Note: Some database flag settings can affect instance availability and/or stability, and eventually remove the PostgreSQL instance from the Google Cloud SQL Service Level Agreement (SLA).
Audit
To determine if the "log_planner_stats" flag is disabled for your Google Cloud PostgreSQL database instances, perform the following operations:
Remediation / Resolution
To disable the "log_planner_stats" database flag for your Google Cloud PostgreSQL database instances, perform the following operations:
References
- Google Cloud Platform (GCP) Documentation
- Cloud SQL for PostgreSQL documentation
- Configure database flags
- Edit instances
- CIS Security Documentation
- Securing Google Cloud Computing Platform
- GCP Command Line Interface (CLI) Documentation
- gcloud projects list
- gcloud sql instances list
- gcloud sql instances describe
- gcloud sql instances patch