Re: [PATCH] Remove Extra palloc Of raw_buf For Binary Format In COPY FROM

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Remove Extra palloc Of raw_buf For Binary Format In COPY FROM
Date: 2020-07-18 04:38:55
Message-ID: CALj2ACU_V2Jf2shpoj0zV0VmpfarSu842XW1nn10CjcjUAHD+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jul 11, 2020 at 11:53 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> vignesh C <vignesh21(at)gmail(dot)com> writes:
> > On Tue, Jun 30, 2020 at 2:41 PM Bharath Rupireddy
> > <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> >> I've added this patch to commitfest - https://commitfest.postgresql.org/28/.
>
> > I felt this patch is ready for committer, changing the status to ready
> > for committer.
>
> Pushed with some fiddling. Mainly, if we're going to the trouble of
> checking for binary mode here, we might as well skip allocating the
> line_buf too.
>

Hi Tom,

Isn't it good if we backpatch this to versions 13, 12, 11 and so on?
As we can save good amount of memory with this patch for non-binary
copy.

Attaching the patch which applies on versions 13, 12, 11.

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
v1-0001-Avoid-useless-buffer-allocations-during-binary-CO.patch application/octet-stream 2.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-07-18 05:03:21 Re: [PATCH] Remove Extra palloc Of raw_buf For Binary Format In COPY FROM
Previous Message Noah Misch 2020-07-18 02:57:40 Re: Which SET TYPE don't actually require a rewrite