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 8AF219DC87A for ; Tue, 3 Jan 2006 20:00:12 -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 49800-06 for ; Tue, 3 Jan 2006 20:00:15 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 4AB189DC83E for ; Tue, 3 Jan 2006 20:00:10 -0400 (AST) 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 k0400C2J027721; Tue, 3 Jan 2006 19:00:12 -0500 (EST) To: Steve Eckmann cc: pgsql-performance@postgresql.org Subject: Re: improving write performance for logging application In-reply-to: <43BB0C5C.8020207@computer.org> References: <43BB0C5C.8020207@computer.org> Comments: In-reply-to Steve Eckmann message dated "Tue, 03 Jan 2006 16:44:28 -0700" Date: Tue, 03 Jan 2006 19:00:12 -0500 Message-ID: <27720.1136332812@sss.pgh.pa.us> From: Tom Lane 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/4 X-Sequence-Number: 16482 Steve Eckmann writes: > We also found that we could improve MySQL performance significantly > using MySQL's "INSERT" command extension allowing multiple value-list > tuples in a single command; the rate for MyISAM tables improved to > about 2600 objects/second. PostgreSQL doesn't support that language > extension. Using the COPY command instead of INSERT might help, but > since rows are being generated on the fly, I don't see how to use COPY > without running a separate process that reads rows from the > application and uses COPY to write to the database. Can you conveniently alter your application to batch INSERT commands into transactions? Ie BEGIN; INSERT ...; ... maybe 100 or so inserts ... COMMIT; BEGIN; ... lather, rinse, repeat ... This cuts down the transactional overhead quite a bit. A downside is that you lose multiple rows if any INSERT fails, but then the same would be true of multiple VALUES lists per INSERT. regards, tom lane