Re: how many record versions

From: David Garamond <lists(at)zara(dot)6(dot)isreserved(dot)com>
To: Manfred Koizar <mkoi-pg(at)aon(dot)at>, pgsql-general(at)postgresql(dot)org
Subject: Re: how many record versions
Date: 2004-05-23 16:32:48
Message-ID: 40B0D230.6030803@zara.6.isreserved.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Manfred Koizar 2004-05-23 18:11:58 Re: how many record versions
Previous Message Tom Lane 2004-05-23 15:54:48 Re: how many record versions