Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id BE76064FD2F for ; Wed, 10 Sep 2008 14:17:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 23414-06 for ; Wed, 10 Sep 2008 14:17:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hi-media.com (9.140-14-84.ripe.coltfrance.com [84.14.140.9]) by postgresql.org (Postfix) with ESMTP id 6E30D64FD15 for ; Wed, 10 Sep 2008 14:17:46 -0300 (ADT) Received: from dim (gut75-1-81-57-27-121.fbx.proxad.net [81.57.27.121]) by hi-media.com (Postfix) with ESMTP id 5367018809E for ; Wed, 10 Sep 2008 19:17:36 +0200 (CEST) From: Dimitri Fontaine Organization: Hi-Media To: pgsql-performance@postgresql.org Subject: Re: Improve COPY performance for large data sets Date: Wed, 10 Sep 2008 19:17:37 +0200 User-Agent: KMail/1.9.9 References: <48C7FA69.1080507@brightbuilders.com> In-Reply-To: <48C7FA69.1080507@brightbuilders.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1291707.uRBvZ8eSTv"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200809101917.40204.dfontaine@hi-media.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.1 tagged_above=0 required=5 tests=RDNS_DYNAMIC=0.1 X-Spam-Level: X-Archive-Number: 200809/112 X-Sequence-Number: 31425 --nextPart1291707.uRBvZ8eSTv Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, Le mercredi 10 septembre 2008, Ryan Hansen a =E9crit=A0: > One thing I'm experiencing some trouble with is running a COPY of a > large file (20+ million records) into a table in a reasonable amount of > time. Currently it's taking about 12 hours to complete on a 64 bit > server with 3 GB memory allocated (shared_buffer), single SATA 320 GB > drive. I don't seem to get any improvement running the same operation > on a dual opteron dual-core, 16 GB server. You single SATA disk is probably very busy going from reading source file t= o=20 writing data. You could try raising checkpoint_segments to 64 or more, but = a=20 single SATA disk won't give you high perfs for IOs. You're getting what you= =20 payed for... You could maybe ease the disk load by launching the COPY from a remote (loc= al=20 netword) machine, and while at it if the file is big, try parallel loading= =20 with pgloader. Regards, =2D-=20 dim --nextPart1291707.uRBvZ8eSTv Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkjIATEACgkQlBXRlnbh1blVmgCgrG2074cfSQRAHC5fLGCl6Is4 UaMAn0245z4RGkqfWrEz0E8nexTcZ8Xz =Uva2 -----END PGP SIGNATURE----- --nextPart1291707.uRBvZ8eSTv--