]> git.ipfire.org Git - thirdparty/postgresql.git/commit
pg_plan_advice: Fix another unique-semijoin bug.
authorRobert Haas <rhaas@postgresql.org>
Fri, 17 Apr 2026 18:08:37 +0000 (14:08 -0400)
committerRobert Haas <rhaas@postgresql.org>
Fri, 17 Apr 2026 18:08:37 +0000 (14:08 -0400)
commit4321dcad475bc7cbb4efe18c0b0652a0506e8348
treea937ea4839490684e4afb392452dbb71e00b2c4b
parentf3ae1ec7295b6c4d54974eea14bef4b917dc2c7e
pg_plan_advice: Fix another unique-semijoin bug.

This one occurs when an outer join appears beneath the made-unique
side of a semijoin. The issue is that join RTEs are not featured
out of sj_unique_rels entries. Fix, and add a test case.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Analyzed-by: Tender Wang <tndrwang@gmail.com>
Discussion: http://postgr.es/m/c0c63979-43c2-4424-8fe8-56949934c9d8@gmail.com
contrib/pg_plan_advice/expected/semijoin.out
contrib/pg_plan_advice/pgpa_planner.c
contrib/pg_plan_advice/sql/semijoin.sql