pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Test pg_plan_advice using a new test_plan_advice module.
Date: Tue, 17 Mar 2026 18:15:40 +0000
Message-ID: <E1w2YxA-000CYk-0K@gemulon.postgresql.org> (raw)

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

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(+)



Message-ID: <E1w2YxA-000CYk-0K@gemulon.postgresql.org>
Permalink:  ../E1w2YxA-000CYk-0K@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w2YxA-000CYk-0K@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Test pg_plan_advice using a new test_plan_advice module.
  In-Reply-To: <E1w2YxA-000CYk-0K@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox