[pgpool-general: 9228] Re: PGPOOL load

Tatsuo Ishii ishii at postgresql.org
Mon Oct 21 19:00:53 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

Sorry, the example was not appropreate since the cat command is
executed on the same server as PostgreSQL backend, and the data does
not fly through pgpool. More appropreate example is using COPY TO STDOUT.

t-ishii$ time psql -p 11000 test -c "copy pgbench_accounts to stdout" > /tmp/copy.out

real	0m0.073s
user	0m0.000s
sys	0m0.031s

This took 73 ms and slow.

> 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
> _______________________________________________
> pgpool-general mailing list
> pgpool-general at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-general


More information about the pgpool-general mailing list