pgsql: Fix thinko in join removal.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix thinko in join removal.
Date: 2023-05-19 19:24:16
Message-ID: E1q05i4-000ikP-Go@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix thinko in join removal.

In commit 9df8f903e I (tgl) switched join_is_removable() from
using the min relid sets of the join under consideration to
using its full syntactic relid sets. This was a mistake,
as it allowed join removal in cases where a reference to the
join output would survive in some syntactically-lower join
condition. Revert to the former coding.

Richard Guo

Discussion: https://postgr.es/m/CAMbWs4-EU9uBGSP7G-iTwLBhRQ=rnZKvFDhD+n+xhajokyPCKg@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/optimizer/plan/analyzejoins.c | 11 ++++-------
src/test/regress/expected/join.out | 16 ++++++++++++++++
src/test/regress/sql/join.sql | 5 +++++
3 files changed, 25 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2023-05-19 20:36:51 pgsql: Do pre-release housekeeping on catalog data.
Previous Message Tom Lane 2023-05-19 18:27:32 pgsql: Fix misbehavior of EvalPlanQual checks with multiple result rela