Re: Add semi-join pushdown to postgres_fdw
Alexander Korotkov <aekorotkov@gmail.com>
From: Alexander Korotkov <aekorotkov@gmail.com>
To: Alexander Pyhalov <a.pyhalov@postgrespro.ru>
Cc: Robins Tharakan <tharakan@gmail.com>, "Fujii.Yuki@df.MitsubishiElectric.co.jp"
<Fujii.Yuki@df.mitsubishielectric.co.jp>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>,
Pgsql Hackers <pgsql-hackers@postgresql.org>, Ian Lawrence Barwick <barwick@gmail.com>, tndrwang@gmail.com
Date: 2025-03-24T01:21:36Z
Lists: pgsql-hackers
Attachments
- v2-0001-Avoid-pulling-up-restrict-infos-from-subqueries.patch (application/octet-stream) patch v2-0001
Hi, Alexander! On Tue, Mar 18, 2025 at 6:04 PM Alexander Pyhalov <a.pyhalov@postgrespro.ru> wrote: > This shouldn't. When semi-join is found below left/right join, it's > deparsed as subquery. > Interesting enough, this mechanics (deparsing as subquery) is used > 1) for semi-joins under left/right join, > 2) for full outer joins when inner or outer part has some remote_conds. > > The issue here is that after subquery is deparsed, we don't consider if > its target attributes are available to the upper level > join . As for semi-join itself, all conditions are still deparsed on > left/right join boundary, they are just not propagated further. > This shouldn't be a problem, as they are evaluated in subquery. As for > left/right join without semi-join beneath it - its behavior is not > affected > (as hidden_subquery_rels is empty). Thank you for the explanation. But I have another question. Aren't the checks you've proposed too strict? hidden_subquery_rels are propagated all the way to the join tree. So, pulling conditions would be disables all the way to the join tree too. Is it enough to just disable pulling conditions directly from semi-joins, then their further pulls will be disabled automatically? See the attached patch. It also contains other (mostly cosmetic improvements). ------ Regards, Alexander Korotkov Supabase
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
postgres_fdw: Avoid pulling up restrict infos from subqueries
- 729fe699e612 17.5 landed
- 023fb512755f 18.0 landed
-
Add support for deparsing semi-joins to contrib/postgres_fdw
- 824dbea3e41e 17.0 landed
-
Move PartitioPruneInfo out of plan nodes into PlannedStmt
- ec386948948c 16.0 cited