Re: CLUSTER and MVCC

Поиск
Список
Период
Сортировка
От Florian G. Pflug
Тема Re: CLUSTER and MVCC
Дата
Msg-id 45F18E9F.5040601@phlo.org
обсуждение исходный текст
Ответ на Re: CLUSTER and MVCC  (Heikki Linnakangas <heikki@enterprisedb.com>)
Список 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 по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: CLUSTER and MVCC
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Interaction of PITR backups and Bulk operationsavoiding WAL