My apologies. The wiki said to discuss early, even before writing the code if possible, but I added a link to the PR for those who really wanted to see the details.
I'm attaching a diff now. This is not a patch, it's just a discussion piece.
The problem was that PQgetCopyData loops use a lot of CPU time, and this alternative reduces that by a lot.
Jeroen
On Thu, 2 Mar 2023 at 13:38, Daniel Gustafsson <daniel@yesql.se> wrote:
> On 1 Mar 2023, at 15:23, Jeroen Vermeulen <jtvjtv@gmail.com> wrote:
The process for discussing work on pgsql-hackers is to attach the patch to the email and discuss it inline in the thread. That way all versions of the patch as well as the discussion is archived and searchable.