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 <[email protected]>
Reviewed-by: Lukas Fittl <[email protected]>
Discussion: 
http://postgr.es/m/CA%2BTgmoZzM2i%2Bp-Rxdphs4qx7sshn-kzxF91ASQ5duOo0dFRXLQ%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e0e4c132ef2b59f42b9d01872c69607983f3ef31

Modified Files
--------------
src/test/modules/Makefile                          |   1 +
src/test/modules/meson.build                       |   1 +
src/test/modules/test_plan_advice/Makefile         |  28 ++++
src/test/modules/test_plan_advice/meson.build      |  29 +++++
.../test_plan_advice/t/001_replan_regress.pl       |  65 ++++++++++
.../modules/test_plan_advice/test_plan_advice.c    | 143 +++++++++++++++++++++
6 files changed, 267 insertions(+)

Reply via email to