Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 29BA91337BCF for ; Mon, 14 Mar 2011 12:56:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 38574-01-6 for ; Mon, 14 Mar 2011 15:56:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from imr-ma03.mx.aol.com (imr-ma03.mx.aol.com [64.12.206.41]) by mail.postgresql.org (Postfix) with ESMTP id E7CDB1337CBE for ; Mon, 14 Mar 2011 12:54:59 -0300 (ADT) Received: from imo-ma04.mx.aol.com (imo-ma04.mx.aol.com [64.12.78.139]) by imr-ma03.mx.aol.com (8.14.1/8.14.1) with ESMTP id p2EFso1w030202 for ; Mon, 14 Mar 2011 11:54:50 -0400 Received: from runner@winning.com by imo-ma04.mx.aol.com (mail_out_v42.9.) id k.d07.7cc49bfc (34965) for ; Mon, 14 Mar 2011 11:54:48 -0400 (EDT) Received: from smtprly-da01.mx.aol.com (smtprly-da01.mx.aol.com [205.188.249.144]) by cia-da07.mx.aol.com (v129.9) with ESMTP id MAILCIADA072-5baa4d7e3a3d20; Mon, 14 Mar 2011 11:54:41 -0400 Received: from web-mmc-m04 (web-mmc-m04.sim.aol.com [64.12.224.137]) by smtprly-da01.mx.aol.com (v129.9) with ESMTP id MAILSMTPRLYDA011-5baa4d7e3a3d20; Mon, 14 Mar 2011 11:54:39 -0400 References: <8CDAFB3EE5DFE5F-1AE0-21557@web-mmc-d02.sysops.aol.com> To: pgsql-performance@postgresql.org Subject: Re: Tuning massive UPDATES and GROUP BY's? Date: Mon, 14 Mar 2011 11:54:39 -0400 X-AOL-IP: 205.127.233.59 In-Reply-To: X-MB-Message-Source: WebUI MIME-Version: 1.0 From: runner X-MB-Message-Type: User Content-Type: multipart/alternative; boundary="--------MB_8CDB0774277BB85_27F8_18DE_web-mmc-m04.sysops.aol.com" X-Mailer: Mail.com Webmail 33356-STANDARD Received: from 205.127.233.59 by web-mmc-m04.sysops.aol.com (64.12.224.137) with HTTP (WebMailUI); Mon, 14 Mar 2011 11:54:37 -0400 Message-Id: <8CDB0773FE92165-27F8-BD4@web-mmc-m04.sysops.aol.com> X-AOL-SENDER: runner@winning.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.888 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201103/137 X-Sequence-Number: 42816 ----------MB_8CDB0774277BB85_27F8_18DE_web-mmc-m04.sysops.aol.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" =20 =20 =20 > Bulk data imports of this size I've done with minimal pain by simply=20 > breaking the raw data into chunks (10M records becomes 10 files of=20 > 1M records), on a separate spindle from the database, and performing=20 > multiple COPY commands but no more than 1 COPY per server core. =20 > I tested this a while back on a 4 core server and when I attempted 5=20 > COPY's at a time the time to complete went up almost 30%. I don't=20 > recall any benefit having fewer than 4 in this case but the server was= =20 > only processing my data at the time. Indexes were on the target table= =20 > however I dropped all constraints. The UNIX split command is handy=20 > for breaking the data up into individual files. I'm not using COPY. My dump file is a bunch if INSERT INTO statements. = I know it would be faster to use copy. If I can figure out how to do thi= s in one hour I will try it. I did two mysqldumps, one with INSERT INTO= and one as CSV to I can try COPY at a later time. I'm running five para= llel psql processes to import the data which has been broken out by table. =20 ----------MB_8CDB0774277BB85_27F8_18DE_web-mmc-m04.sysops.aol.com Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="us-ascii"



> Bulk data imports of this size I've done with minimal pain by si= mply
> breaking the raw data into chunks (10M records becomes 10 files of > 1M records), on a separate spindle from the database, and performing=
> multiple COPY commands but no more than 1 COPY per server core. =
> I tested this a while back on a 4 core server and when I attempted 5=
> COPY's at a time the time to complete went up almost 30%.  I don= 't
> recall any benefit having fewer than 4 in this case but the server wa= s
> only processing my data at the time.  Indexes were on the target= table
> however I dropped all constraints.  The UNIX split command is ha= ndy
> for breaking the data up into individual files.

I'm not using COPY.  My dump file is a bunch if INSERT INTO statement= s.  I know it would be faster to use copy.  If I can figure out= how to do this in one hour I will try it.  I did two mysqldumps, one= with INSERT INTO and one as CSV to I can try COPY at a later time. &= nbsp; I'm running five parallel psql processes to import the data which ha= s been broken out by table.
----------MB_8CDB0774277BB85_27F8_18DE_web-mmc-m04.sysops.aol.com--