X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3D104D1B349 for ; Sun, 23 May 2004 13:33:13 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 68109-05 for ; Sun, 23 May 2004 13:32:52 -0300 (ADT) Received: from builder.localdomain (unknown [61.94.126.87]) by svr1.postgresql.org (Postfix) with SMTP id 07A42D1B1C7 for ; Sun, 23 May 2004 13:32:47 -0300 (ADT) Received: (qmail 25666 invoked from network); 23 May 2004 16:32:49 -0000 Received: from localhost (HELO localhost.localdomain) (127.0.0.1) by builder.localdomain with SMTP; 23 May 2004 16:32:49 -0000 Received: from 192.168.0.103 by builder.localdomain (MWN SMTPD 0.0.8-pre/20040508) id 847f6f438bfe31dc57509c8e14addeb5 with SMTP; 23 May 2004 16:32:49 +0000 Message-ID: <40B0D230.6030803@zara.6.isreserved.com> Date: Sun, 23 May 2004 23:32:48 +0700 From: David Garamond User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040421 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Manfred Koizar , pgsql-general@postgresql.org Subject: Re: how many record versions References: <40AFAD9F.6000104@zara.6.isreserved.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/712 X-Sequence-Number: 61146 Manfred Koizar wrote: >>begin; >>update t set val=val+1; -- 1000 times >>commit; >> >>How many record versions does it create? 1 or 1000? > > 1000 > >>I'm implementing a >>banner counter which is incremented at least 2-3 millions a day. > > How many rows? I would VACUUM that table after every few hundred > updates or whenever 10% to 20% of the rows have been updated, whichever > is greater. Actually, each record will be incremented probably only thousands of times a day. But there are many banners. Each record has a (bannerid, campaignid, websiteid, date, countrycode) "dimensions" and (impression, click) "measures". The table currently has +- 1,5-2 mil records (it's in MyISAM MySQL), so I'm not sure if I can use that many sequences which Tom suggested. Every impression (banner view) and click will result in a SQL statement (= a "transaction" in MyISAM, since MyISAM doesn't support BEGIN + COMMIT). I'm contemplating of moving to Postgres, but am worried with the MVCC thing. I've previously tried briefly using InnoDB in MySQL but have to revert back to MyISAM because the load increased significantly. -- dave