Re: Oversight in reparameterize_path_by_child leading to executor crash

From: Andrey Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>
To: Richard Guo <guofenglinux(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Oversight in reparameterize_path_by_child leading to executor crash
Date: 2023-09-20 07:18:20
Message-ID: 4c4a36d6-c427-b496-05b0-0e2adbb835a5@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 23/8/2023 12:37, Richard Guo wrote:
> If we go with the "tablesample scans can't be reparameterized" approach
> in the back branches, I'm a little concerned that what if we find more
> cases in the futrue where we need modify RTEs for reparameterization.
> So I spent some time seeking and have managed to find one: there might
> be lateral references in a scan path's restriction clauses, and
> currently reparameterize_path_by_child fails to adjust them.
It may help you somehow: in [1], we designed a feature where the
partitionwise join technique can be applied to a JOIN of partitioned and
non-partitioned tables. Unfortunately, it is out of community
discussions, but we still support it for sharding usage - it is helpful
for the implementation of 'global' tables in a distributed
configuration. And there we were stuck into the same problem with
lateral relids adjustment. So you can build a more general view of the
problem with this patch.

[1] Asymmetric partition-wise JOIN
https://www.postgresql.org/message-id/flat/CAOP8fzaVL_2SCJayLL9kj5pCA46PJOXXjuei6-3aFUV45j4LJQ%40mail.gmail.com

--
regards,
Andrey Lepikhov
Postgres Professional

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Lepikhov 2023-09-20 07:56:53 Re: disfavoring unparameterized nested loops
Previous Message Amit Kapila 2023-09-20 06:46:53 Re: [PoC] pg_upgrade: allow to upgrade publisher node