Re: Missing MaterialPath support in reparameterize_path_by_child - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Missing MaterialPath support in reparameterize_path_by_child
Date
Msg-id 3175242.1670251415@sss.pgh.pa.us
Whole thread Raw
In response to Re: Missing MaterialPath support in reparameterize_path_by_child  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
Responses Re: Missing MaterialPath support in reparameterize_path_by_child  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Pavel Borisov
Date:
Subject: Re: Allow placeholders in ALTER ROLE w/o superuser
Next
From: Vik Fearing
Date:
Subject: ANY_VALUE aggregate