Re: [HACKERS] row reuse while UPDATE and vacuum analyze problem

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: The Hermit Hacker <scrappy(at)hub(dot)org>
Cc: pgsql-hackers(at)postgreSQL(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us, vadim(at)krs(dot)ru
Subject: Re: [HACKERS] row reuse while UPDATE and vacuum analyze problem
Date: 1999-07-28 12:29:40
Message-ID: 3.0.5.32.19990728222940.00b222e0@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 09:00 28/07/99 -0300, you wrote:
>On Wed, 28 Jul 1999, Oleg Bartunov wrote:
>
>Actually, there is a tought...if I understand the concept of MVCC, how is
>reusing a row going to work? My understanding is that I can "physically"
>have to copies of a row in a table, one newer then the other. So, if
>someone is running a SELECT while I'm doing an UPDATE, their SELECT will
>take the older version of hte row (the row at the time their SELECT
>started)...depending on how busy that table is, there will have to be some
>sort of mechanism for determining how 'stale' a row is, no?
>
>ie. on a *very* large table, with multiple SELECT/UPDATEs happening?
>

I presume that's part of MVCC - if PGSQL has a 'transaction id', then you
only need to keep copies of rows back to the earliest started active tx. In
fact, you only really need to keep versions to satisfy all currenct active
tx's (ie. you don't need *all* intermediate versions). You must also keep a
copy of a row prior to the current writer's update (until they commit).

There was talk a while back about doing a 'background vacuum' - did the
talk go anywhere, because reusing space is probably the only way to solve
the infinite growth problem.

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.C.N. 008 659 498) | /(@) ______---_
Tel: +61-03-5367 7422 | _________ \
Fax: +61-03-5367 7430 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 1999-07-28 12:33:32 Re: [HACKERS] Arbitrary tuple size
Previous Message Oleg Bartunov 1999-07-28 12:28:27 Re: [HACKERS] row reuse while UPDATE and vacuum analyze problem