I want to use Amazon CloudWatch Database Insights Advanced mode to log and analyze query execution plans for my Amazon Aurora PostgreSQL-Compatible Edition database (DB) cluster.
Resolution
Note: To use the Advanced mode of Database Insights, your DB instance must use Aurora PostgreSQL-Compatible version 14.10, 15.5, or later. To upgrade your DB cluster, see Upgrading Amazon Aurora PostgreSQL DB clusters.
Turn on Advanced mode
To turn on Advanced mode, see Turning on the Advanced mode of Database Insights for Amazon Aurora.
Activate execution plan logs
Complete the following steps:
- Open the Amazon Relational Database Service (Amazon RDS) console.
- In the navigation pane, choose Databases.
- Select your Aurora PostgreSQL DB cluster.
- Choose Configuration.
- In the DB cluster parameter group section, choose the parameter group link.
- Search for the aurora_compute_plan_id parameter, and then set the value to 1.
Note: For a list of other parameters that you can configure, see Parameter reference for Aurora PostgreSQL query execution plans.
- Choose Save changes.
Analyze execution plans
To analyze your execution plans, see Analyze execution plans. Also, see Monitoring query execution plans and peak memory for Aurora PostgreSQL.
Troubleshoot execution plan issues
If you can't view your execution plans, then take the following actions:
Note: Database Insights captures connection sessions at 1-second intervals. However, it might not display queries with short execution times or little effect on the DB load.