Re: libpq: PQgetCopyData() and allocation overhead

From: Jeroen Vermeulen <jtvjtv(at)gmail(dot)com>
To: daniel(at)yesql(dot)se
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: libpq: PQgetCopyData() and allocation overhead
Date: 2023-03-02 19:44:48
Message-ID: CA+zULE5M8CujFba55g4NkGSSgRhxLeUhZbX+Q2oBivBcrmYyzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)yesql(dot)se> wrote:

> > On 1 Mar 2023, at 15:23, Jeroen Vermeulen <jtvjtv(at)gmail(dot)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 Content-Type Size
PQhandleCopyData.patch text/x-patch 9.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2023-03-02 19:45:51 Re: Minimal logical decoding on standbys
Previous Message reid.thompson 2023-03-02 19:41:26 Re: Add the ability to limit the amount of memory that can be allocated to backends.