pgsql: pg_plan_advice: Fix advice feedback JOIN_ORDER over a single sub - Mailing list pgsql-committers

From Robert Haas
Subject pgsql: pg_plan_advice: Fix advice feedback JOIN_ORDER over a single sub
Date
Msg-id E1xFF6y-00000000yaW-0DGp@gemulon.postgresql.org
Whole thread
List pgsql-committers
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
------
master

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

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


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: pg_plan_advice: Don't suppress NO_GATHER advice for parent rels.
Next
From: Heikki Linnakangas
Date:
Subject: pgsql: Fix check on test function's arguments