Re: CLUSTER and MVCC

From: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: Csaba Nagy <nagy(at)ecircle-ag(dot)com>, postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CLUSTER and MVCC
Date: 2007-03-09 16:43:11
Message-ID: 45F18E9F.5040601@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas wrote:
> The implementation problem is that we don't have a global view of all
> snapshots in the system. If we solve that, we can be more aggressive
> with vacuuming in presence of long-running transactions. It's not an
> easy problem, we don't want to add a lot of accounting overhead, but
> maybe we could have some kind of an approximation of the global state
> with little overhead, that would give most of the benefit.

Hm.. Maybe there could be a fixed-sized list of xids together with
a usecount in shared memory.
If a transaction puts an xid into it's snapshot, it increments the
usecount of that xid in the global list (inserting it if it's not
already in the list). If there is no free space in the list, it
first removes all xid with xid < oldestxmin. If there is still no
free space, it does nothing.
When the transaction is done with the snapshot, it decrements all
the usecounts of xids it incremented before.

You than know that a xid is *not* viewed as in-progress by any
transaction if the xid is in that list, and has a refcount of zero.

greetings, Florian Pflug

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-03-09 16:47:53 Re: Interaction of PITR backups and Bulk operationsavoiding WAL
Previous Message Heikki Linnakangas 2007-03-09 16:40:54 Re: CLUSTER and MVCC