Don't reprocess PHV copies within outer level agg

Edit
ID 7363
Title Don't reprocess PHV copies within outer level agg
CI (CFBot) Summary
Stats (from CFBot) Patch version: v1, Patch count: 1, First patch: +81−3, All patches: +81−3
Tags Bugfix
Created 2026-09-29 10:26:06
Last modified 2026-10-06 03:20:36 (2 weeks ago)
Latest email 2026-10-06 02:04:29 (2 weeks ago)
Status
PG20-3 (2026-11-01 – 2026-11-30): Committed
Target version stable
Authors Ayush Tiwari (aytiwari)
Reviewers Become reviewer
Committer Richard Guo (richardguo)
Links
Emails
remove_useless_joins vs. bug #19560
First at 2026-07-20 18:52:24 by Tom Lane <tgl at sss.pgh.pa.us>
Latest at 2026-10-06 02:04:29 by Richard Guo <guofenglinux at gmail.com>
Latest attachment (v1-0001-Don-t-reprocess-PHV-copies-within-outer-level-agg.patch) at 2026-10-03 18:43:33 from Ayush Tiwari <ayushtiwari.slg01 at gmail.com>
    Attachment (v1-0001-Don-t-reprocess-PHV-copies-within-outer-level-agg.patch) at 2026-10-03 18:43:33 from Ayush Tiwari <ayushtiwari.slg01 at gmail.com> (Patch: No)
    Attachment (v1-0001-Prevent-self-join-elimination-when-RTEs-checkAsUs.patch) at 2026-09-27 16:32:12 from Tom Lane <tgl at sss.pgh.pa.us> (Patch: No)
    Attachment (sje-must-compare-user-ids-too.patch) at 2026-09-26 19:27:52 from Tom Lane <tgl at sss.pgh.pa.us> (Patch: Yes)
    Attachment (report.md) at 2026-09-26 17:44:57 from Noah Misch <noah at leadboat.com> (Patch: No)
    Attachment (v1-0001-Don-t-reprocess-PHV-copies-within-outer-level-agg.patch) at 2026-09-25 11:43:35 from Ayush Tiwari <ayushtiwari.slg01 at gmail.com> (Patch: No)
    Attachment (v1-0001-Fix-join-removal-when-Vars-reference-the-removed-.patch) at 2026-09-17 02:40:57 from Richard Guo <guofenglinux at gmail.com> (Patch: No)
    Attachment (v1-0001-Fix-preprocessing-of-PHV-copies-pushed-down-into-.patch) at 2026-09-16 04:56:34 from Richard Guo <guofenglinux at gmail.com> (Patch: No)
    Attachment (v3-0001-Fix-stale-copies-of-PHVs-in-subqueries.patch) at 2026-09-10 09:33:37 from Richard Guo <guofenglinux at gmail.com> (Patch: No)
    Attachment (v2-0001-Remove-quals-made-redundant-by-reducing-outer-joi.patch) at 2026-09-01 02:07:55 from Richard Guo <guofenglinux at gmail.com> (Patch: No)
    Attachment (v1-0001-Remove-quals-made-redundant-by-reducing-outer-joi.patch) at 2026-08-31 07:32:02 from Richard Guo <guofenglinux at gmail.com> (Patch: No)
    Attachment (skip-outer-level-PHVs.patch) at 2026-08-30 16:20:41 from Tom Lane <tgl at sss.pgh.pa.us> (Patch: Yes)
    Attachment (v2-0001-Fix-stale-copies-of-PHVs-in-LATERAL-subqueries.patch) at 2026-08-30 06:50:20 from Richard Guo <guofenglinux at gmail.com> (Patch: No)
    Attachment (put-back-preprocessed-PHV.patch) at 2026-08-29 20:10:45 from Tom Lane <tgl at sss.pgh.pa.us> (Patch: Yes)
    Attachment (nocfbot.delta-v6.patch) at 2026-08-27 05:46:18 from Richard Guo <guofenglinux at gmail.com> (Patch: Yes)
    Attachment (nocfbot.delta-v6.patch) at 2026-08-27 01:57:59 from Richard Guo <guofenglinux at gmail.com> (Patch: Yes)
    Attachment (v6-0001-Perform-join-removal-by-editing-the-query-s-joint.patch) at 2026-08-26 17:25:12 from Tom Lane <tgl at sss.pgh.pa.us> (Patch: No)
    Attachment (nocfbot.Some-updates-to-v5.patch) at 2026-08-26 05:26:42 from Richard Guo <guofenglinux at gmail.com> (Patch: No)
    Attachment (v5-join-removal-per-branch-patches.tar.gz) at 2026-07-27 18:21:12 from Tom Lane <tgl at sss.pgh.pa.us> (Patch: No)
    Attachment (benchmark.tar.gz) at 2026-07-26 20:34:43 from Tom Lane <tgl at sss.pgh.pa.us> (Patch: No)
    Attachment (v4-0001-Postpone-initialization-of-all_result_relids-leaf.patch) at 2026-07-26 17:35:14 from Tom Lane <tgl at sss.pgh.pa.us> (Patch: No)
    Attachment (finding-81-queries.sql) at 2026-07-26 04:23:00 from Jacob Brazeal <jacob.brazeal at gmail.com> (Patch: No)
    Attachment (v3-0001-Postpone-initialization-of-all_result_relids-leaf.patch) at 2026-07-26 02:15:28 from Tom Lane <tgl at sss.pgh.pa.us> (Patch: No)
    Attachment (v2-0001-Postpone-initialization-of-all_result_relids-leaf.patch) at 2026-07-25 16:46:34 from Tom Lane <tgl at sss.pgh.pa.us> (Patch: No)
    Attachment (v1-0001-wip-refactor-join-removal.patch) at 2026-07-24 13:38:05 from Richard Guo <guofenglinux at gmail.com> (Patch: No)
History
When Who What
2026-10-06 03:20:36 Ayush Tiwari (aytiwari) Closed in commitfest PG20-3 with status: Committed
2026-10-06 03:20:36 Ayush Tiwari (aytiwari) Changed committer to richardguo
2026-10-03 18:41:08 Ayush Tiwari (aytiwari) Attached mail thread 1186816.1784573544@sss.pgh.pa.us
2026-09-29 10:56:53 Ayush Tiwari (aytiwari) Detached mail thread 1186816.1784573544@sss.pgh.pa.us
2026-09-29 10:26:06 Ayush Tiwari (aytiwari) Attached mail thread 1186816.1784573544@sss.pgh.pa.us
2026-09-29 10:26:06 Ayush Tiwari (aytiwari) Created patch record
Edit