Re: Load data from a csv file without using COPY - Mailing list pgsql-general

From Steve Atkins
Subject Re: Load data from a csv file without using COPY
Date
Msg-id D6AD71DE-88DD-4A02-B566-C1D11C20963A@blighty.com
Whole thread Raw
In response to Re: Load data from a csv file without using COPY  (Ravi Krishna <srkrishna@yahoo.com>)
List pgsql-general
> On Jun 19, 2018, at 10:14 PM, Ravi Krishna <srkrishna@yahoo.com> wrote:
>
>>
>> If performance is relevant then your app should probably be using COPY protocol, not line by line inserts. It's
>> supported by most postgresql access libraries. If your app does that then using "\copy" from psql would be
>> an appropriate benchmark.
>
> Actually the reluctance to not use COPY is to make the benchmark same across two different RDBMS in
> two diff env.

That's something I'd only do if I intended to rig a benchmark between a RDBMS with good bulk import
and one without. If that's not your goal, your approach doesn't seem to make sense and is unlikely
to provide performance metrics that are useful or related to your app performance, unless you intend
to hamstring your app in exactly the same way you're running the benchmark.

Maybe use your app, or write ten minutes worth of code that'll interact with the database in much the
same way as your app will?

Cheers,
  Steve



pgsql-general by date:

Previous
From: Ravi Krishna
Date:
Subject: Re: Load data from a csv file without using COPY
Next
From: Rob Sargent
Date:
Subject: Re: Load data from a csv file without using COPY