Re: Function scan FDW pushdown

From: Alexander Pyhalov <a(dot)pyhalov(at)postgrespro(dot)ru>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: g(dot)kashkin(at)postgrespro(dot)ru, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Function scan FDW pushdown
Date: 2026-03-18 12:08:49
Message-ID: e3af56f9b2f1bd9fdf12aff6ca25b18d@postgrespro.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Álvaro Herrera писал(а) 2025-08-05 22:55:
> Hello,
>
> On 2024-Nov-05, g(dot)kashkin(at)postgrespro(dot)ru wrote:
>
>> This is a long-overdue follow-up to the original patch.
>> Note that this patch contains only the changes required for
>> function scan pushdown, examples and code related to asymmetric
>> join are dropped.
>
> I've marked this as returned with feedback, as several months have
> passed without a further version; the current one has a number of
> gotchas, including some problematic coding detected by a compiler
> warning, as well as unfinished design:
>
>> The issue with setting newrte->functions to NIL still persists.
>> [...]
>> I am aware that the rte->functions will now be copied even on
>> instances that don't utilize a FDW, but I don't see a way to solve it.
>> Any suggestions are welcome.
>
> Feel free to reopen this CF entry[1] once you're able to figure this
> out.
>
> [1] https://commitfest.postgresql.org/patch/5470/

Hi.
I've updated patch with latest fixes, including more checks for corner
cases.
Now function pushdown is forbidden for functions, returning sets of
complex types
or which arguments contain parameters. Together with Gleb Kashkin we've
also moved
information about functions to foreign scan private data. The tricky
part here was
to get correct rti mappings after setrefs, but it seems we've managed to
do it.
Also I've removed some changes, which are required only in presence of
asymmetric
join.

Of course, I'm targeting PostgreSQL 20.
--
Best regards,
Alexander Pyhalov,
Postgres Professional

Attachment Content-Type Size
v2-0001-Push-join-with-function-scan-to-remote-server.patch text/x-diff 63.0 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2026-03-18 12:18:45 Re: Fix uninitialized xl_running_xacts padding
Previous Message Peter Eisentraut 2026-03-18 11:59:51 Re: [PATCH] Add `headerscheck` run_target to meson