X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 1F0B59DCA22 for ; Tue, 3 Jan 2006 20:06:02 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 54130-02 for ; Tue, 3 Jan 2006 20:06:04 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by postgresql.org (Postfix) with ESMTP id 592849DCA07 for ; Tue, 3 Jan 2006 20:05:59 -0400 (AST) Received: from trofast.sesse.net ([129.241.93.32]) by cassarossa.samfundet.no with esmtp (Exim 4.50) id 1EtwAC-0007od-3I; Wed, 04 Jan 2006 01:06:00 +0100 Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) id 1EtwAF-0007gR-00; Wed, 04 Jan 2006 01:06:03 +0100 Date: Wed, 4 Jan 2006 01:06:03 +0100 From: "Steinar H. Gunderson" To: Steve Eckmann Cc: pgsql-performance@postgresql.org Subject: Re: improving write performance for logging application Message-ID: <20060104000603.GA29469@uio.no> Mail-Followup-To: Steve Eckmann , pgsql-performance@postgresql.org References: <43BB0C5C.8020207@computer.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <43BB0C5C.8020207@computer.org> X-Operating-System: Linux 2.6.14.3 on a x86_64 X-Message-Flag: Outlook? --> http://www.mozilla.org/products/thunderbird/ User-Agent: Mutt/1.5.11 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.065 required=5 tests=[AWL=0.065] X-Spam-Score: 0.065 X-Spam-Level: X-Archive-Number: 200601/5 X-Sequence-Number: 16483 On Tue, Jan 03, 2006 at 04:44:28PM -0700, Steve Eckmann wrote: > Are there general guidelines for tuning the PostgreSQL server for this kind > of application? The suggestions I've found include disabling fsync (done), Are you sure you really want this? The results could be catastrophic in case of a crash. > On the client side I've found only two suggestions: disable autocommit and > use COPY instead of INSERT. I think I've effectively disabled autocommit by > batching up to several hundred INSERT commands in each PQexec() call, and > it isn’t clear that COPY is worth the effort in our application. I'm a bit confused here: How can you batch multiple INSERTs into large statements for MySQL, but not batch multiple INSERTs into COPY statements for PostgreSQL? Anyhow, putting it all inside one transaction (or a few) is likely to help quite a lot, but of course less when you have fsync=false. Bunding multiple statements in each PQexec() call won't really give you that; you'll have to tell the database so explicitly. /* Steinar */ -- Homepage: http://www.sesse.net/