pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix thinko in join removal.
Date: Fri, 19 May 2023 19:24:16 +0000
Message-ID: <E1q05i4-000ikP-Go@gemulon.postgresql.org> (raw)

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



Message-ID: <E1q05i4-000ikP-Go@gemulon.postgresql.org>
Permalink:  ../E1q05i4-000ikP-Go@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1q05i4-000ikP-Go@gemulon.postgresql.org

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix thinko in join removal.
  In-Reply-To: <E1q05i4-000ikP-Go@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