Re: CLUSTER and MVCC - Mailing list pgsql-hackers

From Florian G. Pflug
Subject Re: CLUSTER and MVCC
Date
Msg-id 45F18E9F.5040601@phlo.org
Whole thread Raw
In response to Re: CLUSTER and MVCC  (Heikki Linnakangas <heikki@enterprisedb.com>)
List 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


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: CLUSTER and MVCC
Next
From: Tom Lane
Date:
Subject: Re: Interaction of PITR backups and Bulk operationsavoiding WAL