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 <[email protected]>
Discussion: 
http://postgr.es/m/CAJTYsWWe8E8ya-24wRws5LSVhHNxCwLyy8c-ueY-TKvC=8p...@mail.gmail.com
Discussion: 
http://postgr.es/m/ca+tgmoyyhc4i-gpzc9-jyhqih6pok+6ltyfinr-pioxg1nk...@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(-)

Reply via email to