Re: Performance testing of COPY (SELECT) TO

From: Böszörményi Zoltán <zboszor(at)dunaweb(dot)hu>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Performance testing of COPY (SELECT) TO
Date: 2006-08-25 14:18:42
Message-ID: 4463.213.163.11.81.1156515522.squirrel@www.dunaweb.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

> It'd also be interesting to time the same way (with a temp table) in
> devel. I don't remember whether we did any performance work on the
> COPY CSV data path in this cycle, or whether that was all present in
> 8.1. In any case it'd be worth proving that the COPY SELECT patch isn't
> degrading performance of the copy-a-relation case.

In the export, there is a largish table, that has both many columns and rows.

With COPY(SELECT) patch applied:

time psql -c "copy (select * from table) to 'file'" dbx
COPY 886046

real 0m13.253s
user 0m0.000s
sys 0m0.000s

time psql -c "copy table to 'file'" dbx
COPY 886046

real 0m13.234s
user 0m0.000s
sys 0m0.000s

time psql -c "copy table to stdout" dbx >file

real 0m15.155s
user 0m0.540s
sys 0m0.450s

time psql -c "copy (select * from table) to stdout" dbx >file

real 0m15.079s
user 0m0.540s
sys 0m0.590s

Surprisingly, without the COPY(SELECT) patch it's slower,
it's the lowest from five runs, e.g. with warm caches:

time psql -c "copy table to 'file'" dbx

real 0m20.464s
user 0m0.000s
sys 0m0.010s

time psql -c "copy table to stdout" dbx >file

real 0m25.753s
user 0m0.570s
sys 0m0.460s

With the original settings, temp_buffers = 1000 on 8.2CVS,
the one client case looks like this: first run 1:44, second run 1:12,
third run 1:04. It seems it's a bit faster both on startup and on
subsequent runs.

Best regards,
Zoltán Böszörményi

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-08-25 14:20:47 Re: Safer auto-initdb for RPM init script
Previous Message Magnus Hagander 2006-08-25 14:09:49 Re: Safer auto-initdb for RPM init script

Browse pgsql-patches by date

  From Date Subject
Next Message Martin Atukunda 2006-08-25 15:03:55 Re: psql 'none' as a HISTFILE special case
Previous Message Böszörményi Zoltán 2006-08-25 13:40:38 Re: [HACKERS] Performance testing of COPY (SELECT) TO