pgsql: Don't constrain self-join removal due to PHVs

From: Alexander Korotkov <akorotkov(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Don't constrain self-join removal due to PHVs
Date: 2023-12-24 23:33:56
Message-ID: E1rHXym-00Bl71-8z@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Don't constrain self-join removal due to PHVs

Self-join removal appears to be safe to apply with placeholder variables
as long as we handle PlaceHolderVar in replace_varno_walker() and replace
relid in phinfo->ph_lateral.

Discussion: https://postgr.es/m/18187-831da249cbd2ff8e%40postgresql.org
Author: Richard Guo
Reviewed-by: Andrei Lepikhov

Branch
------
master

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

Modified Files
--------------
src/backend/optimizer/plan/analyzejoins.c | 18 ++++----------
src/test/regress/expected/join.out | 39 ++++++++++++++++++++++---------
src/test/regress/sql/join.sql | 10 +++++---
3 files changed, 39 insertions(+), 28 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2023-12-25 04:36:37 pgsql: Fix erroneous -Werror=missing-braces on old GCC.
Previous Message Alexander Korotkov 2023-12-24 23:13:11 pgsql: Enhance checkpointer restartpoint statistics