Test pg_plan_advice using a new test_plan_advice module.
Robert Haas <rhaas@postgresql.org>
Test pg_plan_advice using a new test_plan_advice module. The TAP test included in this new module runs the regression tests with pg_plan_advice loaded. It arranges for each query to be planned twice. The first time, we generate plan advice. The second time, we replan the query using the resulting advice string. If the tests fail, that means that using pg_plan_advice to tell the planner to do what it was going to do anyway breaks something, which indicates a problem either with pg_plan_advice or with the planner. The test also enables pg_plan_advice.feedback_warnings, so that if the plan advice fails to apply cleanly when the query is replanned, a failure will occur. Reviewed-by: Alexandra Wang <alexandra.wang.oss@gmail.com> Reviewed-by: Lukas Fittl <lukas@fittl.com> Discussion: http://postgr.es/m/CA%2BTgmoZzM2i%2Bp-Rxdphs4qx7sshn-kzxF91ASQ5duOo0dFRXLQ%40mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/test/modules/Makefile | modified | +1 −0 |
| src/test/modules/meson.build | modified | +1 −0 |
| src/test/modules/test_plan_advice/Makefile | added | +28 −0 |
| src/test/modules/test_plan_advice/meson.build | added | +29 −0 |
| src/test/modules/test_plan_advice/t/001_replan_regress.pl | added | +65 −0 |
| src/test/modules/test_plan_advice/test_plan_advice.c | added | +143 −0 |
Discussion
- pg_plan_advice 219 messages · 2025-10-30 → 2026-06-10