From: Ravi Krishna <ravikrishna@vivaldi.net>
To: Steven Lembark <lembark@wrkhors.com>
Cc: pgsql-general@lists.postgresql.org
Cc: Matthias Apitz <guru@unixarea.de>
Subject: Re: performance of loading CSV data with COPY is 50 times faster than Perl::DBI
Date: Mon, 3 Feb 2020 11:57:14 -0500
Message-ID: <B45795C7-ACB5-4CB2-AF8E-FAF8C7757978@vivaldi.net> (raw)
In-Reply-To: <20200203100104.2a9d3fcd.lembark@wrkhors.com>
References: <20200131182441.GA8181@c720-r342378>
<20200203100104.2a9d3fcd.lembark@wrkhors.com>
>
> Depending on who wrote the code, they may have extracted the rows
> as hashrefs rather than arrays; that can be a 10x slowdown right
> there. [I have no idea why so many people are so addicted to storing
> rows in hashes, but it is always a significant slowdown; and
> array slices are no more complicated than hash slices!]
I have not done perl code for a while now, but most perl coders, already
suffering from a complex of coding in an unreadable language do not
prefer to make it worse by using array which is position dependent
and hence reading it can be a nightmare when large number of cols are
selected.
Also isn't array_ref even better than array, since it avoids copying the data
to your local array in the code.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ravikrishna@vivaldi.net, lembark@wrkhors.com, guru@unixarea.de
Subject: Re: performance of loading CSV data with COPY is 50 times faster than Perl::DBI
In-Reply-To: <B45795C7-ACB5-4CB2-AF8E-FAF8C7757978@vivaldi.net>
References: <20200131182441.GA8181@c720-r342378> <20200203100104.2a9d3fcd.lembark@wrkhors.com> <B45795C7-ACB5-4CB2-AF8E-FAF8C7757978@vivaldi.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox