pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: David Garamond <lists@zara.6.isreserved.com>
Cc: pgsql-general@postgresql.org
Subject: Re: how many record versions
Date: Sun, 23 May 2004 10:52:37 -0500
Message-ID: <20040523155237.GB25716@wolff.to> (raw)
In-Reply-To: <40AFAD9F.6000104@zara.6.isreserved.com>
References: <40AFAD9F.6000104@zara.6.isreserved.com>

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.



view thread (14+ messages)  latest in thread

Message-ID: <20040523155237.GB25716@wolff.to>
Permalink:  ../20040523155237.GB25716@wolff.to/
Also on:    postgresql.org/message-id/20040523155237.GB25716@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: bruno@wolff.to, lists@zara.6.isreserved.com
  Subject: Re: how many record versions
  In-Reply-To: <20040523155237.GB25716@wolff.to>
  References: <40AFAD9F.6000104@zara.6.isreserved.com> <20040523155237.GB25716@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox