Re: apply_scanjoin_target_to_paths and partitionwise join

Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>

From: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Richard Guo <guofenglinux@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Andrei Lepikhov <lepihov@gmail.com>, Jakub Wartak <jakub.wartak@enterprisedb.com>, arne.roland@malkut.net, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Julien Rouhaud <rjuju123@gmail.com>, Etsuro Fujita <etsuro.fujita@gmail.com>
Date: 2026-01-06T02:54:24Z
Lists: pgsql-hackers
On Mon, Jan 5, 2026 at 11:10 PM Robert Haas <robertmhaas@gmail.com> wrote:
>
> On Wed, Dec 24, 2025 at 9:20 AM Ashutosh Bapat
> <ashutosh.bapat.oss@gmail.com> wrote:
> > I think there's an unwritten convention that we re/set GUCs nearer the
> > queries which require/exercise those. That way they are visible. The
> > test file is about testing partitionwise join, so it's expected that
> > most of the queries will require PWJ enabled. Seeing
> > enable_partitionwise_join = true in the middle of the file made me
> > think that we are disabling PWJ somewhere before to test disabled PWJ
> > and re-enabling it. But I couldn't find a statement disabling it.
> > After spending some time and going through the original commit which
> > added enable_partitionwise_join = true, I realised that it was not
> > required there. I did that exercise twice, once when writing the patch
> > and once while comparing my patch and your commit. Removing that
> > statement will save somebody the same exercise. But I am ok, if we
> > don't want to remove it.
>
> After looking at it, I agree with your analysis, so I've committed your patch.

Thanks.

-- 
Best Wishes,
Ashutosh Bapat



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Remove redundant SET enable_partitionwise_join = on.

  2. Don't reset the pathlist of partitioned joinrels.

  3. Allow left join removals and unique joins on partitioned tables

  4. Consider fractional paths in generate_orderedappend_paths

  5. Fix handling of targetlist SRFs when scan/join relation is known empty.