Re: [PATCH] Performance Improvement For Copy From Binary Files - Mailing list pgsql-hackers

From vignesh C
Subject Re: [PATCH] Performance Improvement For Copy From Binary Files
Date
Msg-id CALDaNm3VW1i72E7Q52BcQMaDMrQAtPhv3eQBMtzRG6-1Ema98w@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Performance Improvement For Copy From Binary Files  (Amit Langote <amitlangote09@gmail.com>)
Responses Re: [PATCH] Performance Improvement For Copy From Binary Files  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
On Mon, Jul 13, 2020 at 8:02 AM Amit Langote <amitlangote09@gmail.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



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Default setting for enable_hashagg_disk
Next
From: vignesh C
Date:
Subject: Re: proposal: possibility to read dumped table's name from file