Re: [PATCH] Performance Improvement For Copy From Binary Files

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(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] Performance Improvement For Copy From Binary Files
Date: 2020-07-13 13:20:24
Message-ID: CALDaNm3VW1i72E7Q52BcQMaDMrQAtPhv3eQBMtzRG6-1Ema98w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 13, 2020 at 8:02 AM Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
> By the way, considering the rebase over cd22d3cdb9b, it seemed to me
> that we needed to update the comments in CopyStateData struct
> definition a bit more. While doing that, I realized
> CopyReadFromRawBuf as a name for the new function might be misleading
> as long as we are only using it for binary data. Maybe
> CopyReadBinaryData is more appropriate? See attached v4 with these
> and a few other cosmetic changes.
>

I had one small comment:
+{
+ int copied_bytes = 0;
+
+#define BUF_BYTES (cstate->raw_buf_len - cstate->raw_buf_index)
+#define DRAIN_COPY_RAW_BUF(cstate, dest, nbytes)\
+ do {\
+ memcpy((dest), (cstate)->raw_buf +
(cstate)->raw_buf_index, (nbytes));\
+ (cstate)->raw_buf_index += (nbytes);\
+ } while(0)

BUF_BYTES could be used in CopyLoadRawBuf function also.

Regards,
Vignesh
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2020-07-13 13:32:59 Re: proposal: possibility to read dumped table's name from file
Previous Message Peter Eisentraut 2020-07-13 13:13:46 Re: Default setting for enable_hashagg_disk