From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_plan_advice: Fix advice feedback JOIN_ORDER over a single sub
Date: Fri, 09 Oct 2026 18:14:28 +0000
Message-ID: <E1xFF6y-00000000yaY-0HeY@gemulon.postgresql.org> (raw)
pg_plan_advice: Fix advice feedback JOIN_ORDER over a single sublist.
Suppose that a JOIN_ORDER() advice target consists of a single
ordered or unordered sublist, something like JOIN_ORDER((...))
or JOIN_ORDER({...}) or even JOIN_ORDER(({...})). In the previous
coding, the feedback for such advice would be "partially matched"
even when the query joined all the relations mentioned. Fix that.
Like the issues fixed by e1d8f81d4961ca6c4228eb9a3ab5d36168008e42,
this escaped detection because advice generation never creates
advice strings that have the problematic form.
Reported-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Discussion: http://postgr.es/m/CAJTYsWWe8E8ya-24wRws5LSVhHNxCwLyy8c-ueY-TKvC=8P7UQ@mail.gmail.com
Discussion: http://postgr.es/m/CA+TgmoYYHC4i-Gpzc9-JYHqih6pOK+6LTYFiNR-PioXG1nKkOQ@mail.gmail.com
Backpatch-through: 19
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/38d3bbff7a53007d555427b3aca98e0692621e4f
Modified Files
--------------
contrib/pg_plan_advice/expected/join_order.out | 59 ++++++++++++++++++++++++++
contrib/pg_plan_advice/pgpa_planner.c | 21 ++++++++-
contrib/pg_plan_advice/sql/join_order.sql | 16 +++++++
3 files changed, 95 insertions(+), 1 deletion(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: rhaas@postgresql.org
Subject: Re: pgsql: pg_plan_advice: Fix advice feedback JOIN_ORDER over a single sub
In-Reply-To: <E1xFF6y-00000000yaY-0HeY@gemulon.postgresql.org>
References: <E1xFF6y-00000000yaY-0HeY@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