pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Improve RowMark handling during Self-Join Elimination 2+ messages / 1 participants [nested] [flat]
* pgsql: Improve RowMark handling during Self-Join Elimination @ 2025-08-26 10:23 Alexander Korotkov <akorotkov@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Alexander Korotkov @ 2025-08-26 10:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Improve RowMark handling during Self-Join Elimination The Self-Join Elimination SJE feature messes up keeping and removing RowMark's in remove_self_joins_one_group(). That didn't lead to user-level error, because the planned RowMark is only used to reference a rtable entry in later execution stages. An RTE entry for keeping and removing relations is identical and refers to the same relation OID. To reduce confusion and prevent future issues, this commit cleans up the code and fixes the incorrect behaviour. Furthermore, it includes sanity checks in setrefs.c on existing non-null RTE and RelOptInfo entries for each RowMark. Discussion: https://postgr.es/m/18c6bd6c-6d2a-419a-b0da-dfedef34b585%40gmail.com Author: Andrei Lepikhov <lepihov@gmail.com> Reviewed-by: Greg Sabino Mullane <htamfids@gmail.com> Backpatch-through: 18 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/5f6f951f88e53630b3ebe9bde762a9612ca6202f Modified Files -------------- src/backend/optimizer/plan/analyzejoins.c | 9 ++++++--- src/backend/optimizer/plan/setrefs.c | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Improve RowMark handling during Self-Join Elimination @ 2025-08-26 10:24 Alexander Korotkov <akorotkov@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Alexander Korotkov @ 2025-08-26 10:24 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Improve RowMark handling during Self-Join Elimination The Self-Join Elimination SJE feature messes up keeping and removing RowMark's in remove_self_joins_one_group(). That didn't lead to user-level error, because the planned RowMark is only used to reference a rtable entry in later execution stages. An RTE entry for keeping and removing relations is identical and refers to the same relation OID. To reduce confusion and prevent future issues, this commit cleans up the code and fixes the incorrect behaviour. Furthermore, it includes sanity checks in setrefs.c on existing non-null RTE and RelOptInfo entries for each RowMark. Discussion: https://postgr.es/m/18c6bd6c-6d2a-419a-b0da-dfedef34b585%40gmail.com Author: Andrei Lepikhov <lepihov@gmail.com> Reviewed-by: Greg Sabino Mullane <htamfids@gmail.com> Backpatch-through: 18 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/8951941fb8a4d7f239760d7a4cd8fcaeecde13e2 Modified Files -------------- src/backend/optimizer/plan/analyzejoins.c | 9 ++++++--- src/backend/optimizer/plan/setrefs.c | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-08-26 10:24 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-08-26 10:23 pgsql: Improve RowMark handling during Self-Join Elimination Alexander Korotkov <akorotkov@postgresql.org> 2025-08-26 10:24 pgsql: Improve RowMark handling during Self-Join Elimination Alexander Korotkov <akorotkov@postgresql.org>
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