Re: Asymmetric partition-wise JOIN

From: Andrey Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>
To: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, Aleksander Alekseev <afiskon(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, KaiGai Kohei <kaigai(at)heterodb(dot)com>
Subject: Re: Asymmetric partition-wise JOIN
Date: 2021-09-15 06:31:15
Message-ID: 792d60f4-37bc-e6ad-68ca-c2af5cbb2d9b@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
v19-0001-Asymmetric-partitionwise-join.patch text/plain 41.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Pyhalov 2021-09-15 06:40:46 Re: Defer selection of asynchronous subplans until the executor initialization stage
Previous Message David Fetter 2021-09-15 06:06:04 Re: Bug fix for tab completion of ALTER TABLE ... VALIDATE CONSTRAINT ...