Re: Asymmetric partition-wise JOIN - Mailing list pgsql-hackers

From Andrey Lepikhov
Subject Re: Asymmetric partition-wise JOIN
Date
Msg-id 792d60f4-37bc-e6ad-68ca-c2af5cbb2d9b@postgrespro.ru
Whole thread Raw
In response to Re: Asymmetric partition-wise JOIN  ("Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>)
Responses Re: Asymmetric partition-wise JOIN
List pgsql-hackers
On 14/9/21 11:37, Andrey V. Lepikhov wrote:
> Thank you for this good catch!
> The problem was in the adjust_child_relids_multilevel routine. The 
> tmp_result variable sometimes points to original required_outer.
> This patch adds new ways which optimizer can generate plans. One 
> possible way is optimizer reparameterizes an inner by a plain relation 
> from the outer (maybe as a result of join of the plain relation and 
> partitioned relation). In this case we have to compare tmp_result with 
> original pointer to realize, it was changed or not.
> The patch in attachment fixes this problem. Additional regression test 
> added.
> 
I thought more and realized there isn't necessary to recurse in the 
adjust_child_relids_multilevel() routine if required_outer contains only
normal_relids.
Also, regression tests were improved a bit.

-- 
regards,
Andrey Lepikhov
Postgres Professional

Attachment

pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: Bug fix for tab completion of ALTER TABLE ... VALIDATE CONSTRAINT ...
Next
From: Alexander Pyhalov
Date:
Subject: Re: Defer selection of asynchronous subplans until the executor initialization stage