[pgpool-general: 9227] Re: PGPOOL load

Tatsuo Ishii ishii at postgresql.org
Mon Oct 21 18:51:56 JST 2024


> I have problem with my pgpool it make very big load when run COPY FROM
> or COPY TO command to import or export file.
> 
> Can you suggest solution.

You mean COPY FROM PROGRAM or STDIN, or COPY TO PROGRAM or STDOUT are
slow? Yes, they are slow because it needs to fly all the data over
network. For example:

copy pgbench_accounts to program 'cat > /tmp/copy.out';
will transfer data like this.
PostgreSQL -> pgpool -> cat -> /tmp/copy.out

On my laptop, the command above took 73.859 ms.
test=# copy pgbench_accounts to program 'cat > /tmp/copy.out';
COPY 100000
Time: 73.859 ms

On the other hand copying to directly local file runs much faster.

test=# copy pgbench_accounts to '/tmp/copy.out';
COPY 100000
Time: 49.378 ms

So my advice is, do followings:

COPY table TO 'file';
or COPY table FROM 'file';

Best reagards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp


More information about the pgpool-general mailing list