X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B81CA52C1F for ; Fri, 19 Aug 2005 09:50:09 -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 80161-04 for ; Fri, 19 Aug 2005 12:50:03 +0000 (GMT) Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by svr1.postgresql.org (Postfix) with ESMTP id C1E8952B3D for ; Fri, 19 Aug 2005 09:50:02 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 85A9530B42; Fri, 19 Aug 2005 15:01:30 +0200 (MET DST) From: Christopher Browne X-Newsgroups: pgsql.performance Subject: Re: Need for speed Date: Fri, 19 Aug 2005 08:00:26 -0400 Organization: cbbrowne Computing Inc Lines: 33 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, berkeley-unix) Cancel-Lock: sha1:2WATvvUFlUBNDukomBEVrYVzI0c= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.116 required=5 tests=[AWL=0.116] X-Spam-Level: X-Archive-Number: 200508/256 X-Sequence-Number: 14003 >> Ulrich Wisser wrote: >> > >> > one of our services is click counting for on line advertising. We do >> > this by importing Apache log files every five minutes. This results in a >> > lot of insert and delete statements. > ... >> If you are doing mostly inserting, make sure you are in a transaction, > > Well, yes, but you may need to make sure that a single transaction > doesn't have too many inserts in it. I was having a performance > problem when doing transactions with a huge number of inserts (tens > of thousands), and I solved the problem by putting a simple counter > in the loop (in the Java import code, that is) and doing a commit > every 100 or so inserts. Are you sure that was an issue with PostgreSQL? I have certainly observed that issue with Oracle, but NOT with PostgreSQL. I have commonly done data loads where they loaded 50K rows at a time, the reason for COMMITting at that point being "programming paranoia" at the possibility that some data might fail to load and need to be retried, and I'd rather have less fail... It would seem more likely that the issue would be on the Java side; it might well be that the data being loaded might bloat JVM memory usage, and that the actions taken at COMMIT time might keep the size of the Java-side memory footprint down. -- (reverse (concatenate 'string "moc.liamg" "@" "enworbbc")) http://cbbrowne.com/info/ If we were meant to fly, we wouldn't keep losing our luggage.