| From: | Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com> |
|---|---|
| To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
| Cc: | KENAN YILMAZ <kenan(dot)yilmaz(at)localus(dot)com(dot)tr>, Andy Fan <zhihuifan1213(at)163(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Bypassing cursors in postgres_fdw to enable parallel plans |
| Date: | 2026-03-04 20:31:51 |
| Message-ID: | CA+FpmFdJg4nis=oMsmgCkRooeAYadptVKvRMUdP+CpTT4qFFMA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Came to know that there were some CI failures. Posting the new version of
the patch which fixes them.
On Mon, 26 Jan 2026 at 03:44, Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com> wrote:
>
>
> On Wed, 10 Dec 2025 at 18:44, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
>>
>>
>> Overall, I think the direction of the patch set has some promise, but
>> I think it needs a lot of cleanup: removal of unnecessary code, proper
>> formatting, moving variables to inner scopes, explanatory comments,
>> good names for variables and functions and structure members, removal
>> of unnecessary files from the patch, cleanup of the regression test
>> coverage so that it doesn't add more bloat than necessary, proper
>> choice of data structures, and so on. Right now, the good things that
>> you've done here are being hidden by these sorts of mechanical issues.
>> That's not just an issue for me as a reviewer: I suspect it's also
>> blocking you, as the patch author, from finding places where the code
>> could be made better. Being able to find such opportunities for
>> improvement and act on them is what will get this patch from
>> "interesting proof of concept" to "potentially committable patch".
>>
>> --
>> Robert Haas
>> EDB: http://www.enterprisedb.com
>>
>
> Thanks Robert for your time and attention to this patch.
> Based on these review comments and an off list discussion about the design
> of the patch, I have reworked the patch significantly.
> In this version, a tuplestore is added to the PgFdwScanState along with
> a flag. Now, in case of a cursor switch, this tuplestore is filled with the
> remaining tuples of the query. The corresponding flag is set to indicate
> that the tuplestore is ready to be fetched. To remember the last query that
> was executing, a pointer to its PgFdwScanState is maintained in the
> conn_state. Note that we only need to remember just the very last query and
> once tuples for it are fetched we can forget that pointer, because now its
> fsstate has the remaining tuples in the tuplestore.
> So, this version of the patch looks simpler than before.
> A few test cases are also added in the attached patch to cover the
> different scenarios in case of non-cursor mode.
> --
> Regards,
> Rafia Sabih
> CYBERTEC PostgreSQL International GmbH
>
--
Regards,
Rafia Sabih
CYBERTEC PostgreSQL International GmbH
| Attachment | Content-Type | Size |
|---|---|---|
| v6-Fetch-without-cursors.patch | application/octet-stream | 55.0 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Zsolt Parragi | 2026-03-04 20:40:34 | Re: Improve OAuth discovery logging |
| Previous Message | Jacob Champion | 2026-03-04 19:37:00 | Re: Improve OAuth discovery logging |