Missing MaterialPath support in reparameterize_path_by_child

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Missing MaterialPath support in reparameterize_path_by_child
Date: 2022-12-02 02:55:23
Message-ID: 1854233.1669949723@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Whilst fooling with my outer-join-aware-Vars patch, I tripped
across a multi-way join query that failed with
ERROR: could not devise a query plan for the given query
when enable_partitionwise_join is on.

I traced that to the fact that reparameterize_path_by_child()
omits support for MaterialPath, so that if the only surviving
path(s) for a child join include materialization steps, we'll
fail outright to produce a plan for the parent join.

Unfortunately, I don't have an example that produces such a
failure against HEAD. It seems certain to me that such cases
exist, though, so I'd like to apply and back-patch the attached.

I'm suspicious now that reparameterize_path() should be
extended likewise, but I don't really have any hard
evidence for that.

regards, tom lane

Attachment Content-Type Size
fix-reparameterize_path_by_child.patch text/x-diff 766 bytes


Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-12-02 02:55:41 Re: Warning When Creating FOR EACH STATEMENT Trigger On Logical Replication Subscriber Side
Previous Message Zheng Li 2022-12-02 02:46:25 Re: Support logical replication of DDLs