From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: In psql \copy from, send data to server in larger chunks.
Date: Wed, 14 Jul 2021 10:10:25 +0000
Message-ID: <E1m3bqT-0003Qc-JW@gemulon.postgresql.org> (raw)
In psql \copy from, send data to server in larger chunks.
Previously, we would send each line as a separate CopyData message.
That's pretty wasteful if the table is narrow, as each CopyData message
has 5 bytes of overhead. For efficiency, buffer up and pack 8 kB of
input data into each CopyData message.
The server also sends each line as a separate CopyData message in COPY TO
STDOUT, and that's similarly wasteful. But that's documented in the FE/BE
protocol description, so changing that would be a wire protocol break.
Reviewed-by: Aleksander Alekseev
Discussion: https://www.postgresql.org/message-id/40b2cec0-d0fb-3191-2ae1-9a3fe16a7e48%40iki.fi
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/eec57115e4c866f26bdc8bcbe3e2e7be4c6d0450
Modified Files
--------------
src/bin/psql/copy.c | 99 ++++++++++++++++++++++++++++++-----------------------
1 file changed, 56 insertions(+), 43 deletions(-)
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-committers@postgresql.org
Cc: heikki.linnakangas@iki.fi
Subject: Re: pgsql: In psql \copy from, send data to server in larger chunks.
In-Reply-To: <E1m3bqT-0003Qc-JW@gemulon.postgresql.org>
References: <E1m3bqT-0003Qc-JW@gemulon.postgresql.org>
* 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