Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id D920964FCCD for ; Wed, 10 Sep 2008 13:48:41 -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 14696-10 for ; Wed, 10 Sep 2008 13:48:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from bb-email.net (bb-email.net [128.121.78.132]) by postgresql.org (Postfix) with ESMTP id 6E00564FCF3 for ; Wed, 10 Sep 2008 13:48:37 -0300 (ADT) Received: from [10.0.1.41] (hammertaprg.hammertap.com [67.50.128.40]) (authenticated bits=0) by bb-email.net (8.13.6.20060614/8.13.6) with ESMTP id m8AGmZ9u073905 for ; Wed, 10 Sep 2008 10:48:36 -0600 (MDT) Message-ID: <48C7FA69.1080507@brightbuilders.com> Date: Wed, 10 Sep 2008 10:48:41 -0600 From: Ryan Hansen User-Agent: Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Improve COPY performance for large data sets Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (bb-email.net [128.121.78.132]); Wed, 10 Sep 2008 10:48:36 -0600 (MDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/108 X-Sequence-Number: 31421 Greetings, I'm relatively new to PostgreSQL but I've been in the IT applications industry for a long time, mostly in the LAMP world. 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. I'm not asking for someone to solve my problem, just some direction in the best ways to tune for faster bulk loading, since this will be a fairly regular operation for our application (assuming it can work this way). I've toyed with the maintenance_work_mem and some of the other params, but it's still way slower than it seems like it should be. So any contributions are much appreciated. Thanks! P.S. Assume I've done a ton of reading and research into PG tuning, which I have. I just can't seem to find anything beyond the basics that talks about really speeding up bulk loads.