Re: Clause accidentally pushed down ( Possible bug in Making Vars outer-join aware)

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andrey Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Clause accidentally pushed down ( Possible bug in Making Vars outer-join aware)
Date: 2023-05-17 08:29:54
Message-ID: CAMbWs48iJprH69xQ27nigwODu1m_4U3Y2WMTxk47sTVdkW0Seg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, May 17, 2023 at 11:10 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> * I'm not terribly happy with 0004 as it stands, specifically the
> business of making build_join_rel recalculate pushed_down_ojrelids
> from scratch. Again, that's adding cycles to the mainline case to
> support an unusual case. It'd be better to make
> add_outer_joins_to_relids have an extra output that is the
> pushed_down_ojrelids set, and pass that forward. I ran out of time
> to make that happen today, though.

Actually I did that in this way before I invented the join_info_array
thing. See patch 'v2-0001-Adjust-outer-join-s-target-list.patch' in
https://www.postgresql.org/message-id/CAMbWs49CB3txv_s3SwC1L2h1DiUPAn%2Bv0-O4UFfg33b%2BHXNnTg%40mail.gmail.com

A little difference is that that patch makes add_outer_joins_to_relids
collect pushed down joins rather than pushed down ojrelids, so that in
build_joinrel_tlist we can just loop over pushed down joins rather than
the whole join_info_list.

I rebased that patch on the v6 patch series and that is 0006 in the
attachment.

* While I've not done it here, I'm seriously considering reverting
> those Asserts in setrefs.c back to somewhat-informative elogs,
> at least till late in beta. It seems like we are still at a point
> where we need to make it easy to acquire info about failures in this
> logic, and using Asserts isn't all that conducive to that.

Agreed. While debugging in my local branch I usually replace the
related Asserts with elogs, to avoid frequent server crashes and to make
it easy for attaching to a live process with gdb.

Thanks
Richard

Attachment Content-Type Size
v6-0006-Collect-pushed-down-outer-joins-in-add_outer_joins_to_relids.patch application/octet-stream 11.1 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2023-05-17 09:42:26 BUG #17937: Corrupt Indexes after reusing DRBD Device on new VM
Previous Message Masahiko Sawada 2023-05-17 05:34:35 Re: BUG #17695: Failed Assert in logical replication snapbuild.