Search Postgresql Archives

Re: how many record versions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 23, 2004 at 02:44:31 +0700,
  David Garamond <lists@zara.6.isreserved.com> wrote:
> begin;
> update t set val=val+1; -- 1000 times
> commit;
> 
> How many record versions does it create? 1 or 1000? I'm implementing a 
> banner counter which is incremented at least 2-3 millions a day. I 
> thought I'd cheat by only commiting after every few minutes. Would that 
> work or would I still create as many record versions?

You might be better off keeping the counter in its own table and vacuuming
that table very often. It is unlikely that holding transactions open
for several minutes is a good idea. Also if you are doing multiple updates
in a single transaction, you are still going to get multiple rows.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux