From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Missing MaterialPath support in reparameterize_path_by_child
Date: Mon, 05 Dec 2022 09:43:35 -0500
Message-ID: <3175242.1670251415@sss.pgh.pa.us> (raw)
In-Reply-To: <CAExHW5tpV7zjY0SSDcg=5N1vddCadZ77oy-2yGQrR0zQQUFsCQ@mail.gmail.com>
References: <1854233.1669949723@sss.pgh.pa.us>
<CAExHW5sCvu58sthGkXRRbrgT2QZkAvaaa2mWjzEHyDZ-iahBxQ@mail.gmail.com>
<1935226.1669995790@sss.pgh.pa.us>
<CAExHW5tpV7zjY0SSDcg=5N1vddCadZ77oy-2yGQrR0zQQUFsCQ@mail.gmail.com>
Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> writes:
> partition-wise join should be willing to fallback to non-partitionwise
> join in such a case. After spending a few minutes with the code, I
> think generate_partitionwise_join_paths() should not call
> set_cheapest() is the pathlist of the child is NULL and should just
> wind up and avoid adding any path.
We clearly need to not call set_cheapest(), but that's not sufficient;
we still fail at higher levels, as you'll see if you try the example
Richard found. I ended up making fe12f2f8f to fix this.
I don't especially like "rel->nparts = 0" as a way of disabling
partitionwise join; ISTM it'd be clearer and more flexible to reset
consider_partitionwise_join instead of destroying the data structure.
But that's the way it's being done elsewhere, and I didn't want to
tamper with it in a bug fix. I see various assertions about parent
and child consider_partitionwise_join flags being equal, which we
might have to revisit if we try to make it work that way.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, ashutosh.bapat.oss@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Missing MaterialPath support in reparameterize_path_by_child
In-Reply-To: <3175242.1670251415@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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