Re: how many record versions - Mailing list pgsql-general

From Tom Lane
Subject Re: how many record versions
Date
Msg-id 24219.1085327688@sss.pgh.pa.us
Whole thread Raw
In response to how many record versions  (David Garamond <lists@zara.6.isreserved.com>)
List pgsql-general
David Garamond <lists@zara.6.isreserved.com> writes:
> 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. I
> thought I'd cheat by only commiting after every few minutes. Would that
> work or would I still create as many record versions?

Won't make a difference.  You should think seriously about using a
sequence rather than an ordinary table for this.

            regards, tom lane

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: how many record versions
Next
From: David Garamond
Date:
Subject: Re: how many record versions