apg_plan_mgmt
apg_plan_mgmt · Amazon Aurora PostgreSQL Query Plan Management extension for managed plan baselines.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100952 | apg_plan_mgmt | apg_plan_mgmt | 3.0 | ADMIN | Unknown | C |
PostgreSQL · 12, 13, 14, 15, 16, 17, 18
Usage
Sources:
- Aurora PostgreSQL query plan management guide
- Query plan management function reference
- Aurora PostgreSQL query plan management release notes
- Aurora PostgreSQL extension version matrix
apg_plan_mgmt is Amazon Aurora PostgreSQL’s provider-managed query plan management extension. It captures optimizer plans, records them in apg_plan_mgmt.dba_plans, and lets administrators approve, reject, prefer, disable, validate, or delete managed plans. Version 3.0 is currently listed for Aurora PostgreSQL 18.3; other engine releases expose different versions.
Enable and inspect plan capture
An Aurora administrator must first set the cluster parameter rds.enable_plan_management to 1, attach the required custom parameter groups, reboot the instance, and create the extension as rds_superuser. A conservative manual-capture session looks like this:
Set apg_plan_mgmt.use_plan_baselines only after reviewing the captured baseline and testing it against representative parameters. Grant the apg_plan_mgmt role only to users who must view or administer plans.
Operational boundary
Plan states such as Approved, Unapproved, Rejected, and Preferred directly influence which execution plans the optimizer may choose. Treat status changes as production configuration changes and keep a rollback path.
apg_plan_mgmt.evolve_plan_baselines runs the captured statement through EXPLAIN ANALYZE with the caller’s privileges. The statement can therefore perform DML or invoke volatile functions; evaluate candidate plans on a non-production clone or restrict the input to statements whose side effects are understood. Availability and the installable extension version are controlled by the Aurora engine release, not by a portable community package.
AWS’s version 3.0 release notes report a fix for plans not being captured and support for sql_hash changes during evolve_plan_baselines. Validate capture and evolution after upgrading rather than assuming existing baselines remain usable unchanged.