Re: postgres_fdw prefers fast plans - Mailing list pgsql-hackers

From Laurenz Albe
Subject Re: postgres_fdw prefers fast plans
Date
Msg-id 2b2d15b9212ed1658603b001a43e23a64ecfc26d.camel@cybertec.at
Whole thread Raw
In response to postgres_fdw prefers fast plans  (Alexander Pyhalov <a.pyhalov@postgrespro.ru>)
Responses Re: postgres_fdw prefers fast plans
List pgsql-hackers
On Wed, 2025-12-10 at 15:44 +0300, Alexander Pyhalov wrote:
> There's a long-standing issue with postgres_fdw - as it uses cursors, it
> prefers plans, optimized for fetching first rows. In bad scenarios this
> leads to suboptimal choice of join methods (e.g. choosing nest loop over
> hash join) on remote side. I've crafted WIP patch, which tries to fix
> this issue. It adds FETCH ALL cursors and uses them in postgres_fdw.
> What do you think? Should we go in this direction?

Why not simply set cursor_tuple_fraction to 1.0 in postgres_fdw sessions?

Yours,
Laurenz Albe



pgsql-hackers by date:

Previous
From: Alexander Pyhalov
Date:
Subject: postgres_fdw prefers fast plans
Next
From: Heikki Linnakangas
Date:
Subject: Re: [Patch] Improve the test src/test/postmaster/t/003_start_stop.pl