X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B04235284C for ; Thu, 19 May 2005 20:44:57 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 27941-07 for ; Thu, 19 May 2005 23:44:47 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 50BFA52823 for ; Thu, 19 May 2005 20:44:46 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j4JNj1NE010302; Thu, 19 May 2005 19:45:01 -0400 (EDT) To: Steve Bergman Cc: pgsql-performance@postgresql.org Subject: Re: Optimizing for writes. Data integrity not critical In-reply-to: <20050519222731.GB20142@uio.no> References: <428D1153.1020109@rueb.com> <20050519222731.GB20142@uio.no> Comments: In-reply-to "Steinar H. Gunderson" message dated "Fri, 20 May 2005 00:27:31 +0200" Date: Thu, 19 May 2005 19:45:01 -0400 Message-ID: <10301.1116546301@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/330 X-Sequence-Number: 12494 "Steinar H. Gunderson" writes: > On Thu, May 19, 2005 at 05:21:07PM -0500, Steve Bergman wrote: >> I'm doing the writes individually. Is there a better way? Combining >> them all into a transaction or something? > Batching them all in one or a few transactions will speed it up a _lot_. > Using COPY would help a bit more on top of that. Also, if you really don't need to worry about data integrity, turning off fsync in the config file will probably help. (Though since it's an IDE drive, maybe not, as the drive may be lying about write complete anyway.) Increasing checkpoint_segments will help too, at the cost of disk space (about 32MB per increment in the value, IIRC). I'd suggest pushing it up enough so you don't incur a checkpoint while the time-critical operation runs. checkpoint_timeout may be too small too. regards, tom lane