Re: libpq: PQgetCopyData() and allocation overhead - Mailing list pgsql-hackers

From Jeroen Vermeulen
Subject Re: libpq: PQgetCopyData() and allocation overhead
Date
Msg-id CA+zULE5M8CujFba55g4NkGSSgRhxLeUhZbX+Q2oBivBcrmYyzQ@mail.gmail.com
Whole thread Raw
In response to Re: libpq: PQgetCopyData() and allocation overhead  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: libpq: PQgetCopyData() and allocation overhead  (Jelte Fennema <postgres@jeltef.nl>)
List pgsql-hackers
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:

> PR for easy discussion: https://github.com/jtv/postgres/pull/1

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.

--
Daniel Gustafsson

Attachment

pgsql-hackers by date:

Previous
From: reid.thompson@crunchydata.com
Date:
Subject: Re: Add the ability to limit the amount of memory that can be allocated to backends.
Next
From: Jeff Davis
Date:
Subject: Re: Minimal logical decoding on standbys