Re: CLUSTER and MVCC

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: CLUSTER and MVCC
Дата
Msg-id 1173443467.3641.212.camel@silverbirch.site
обсуждение исходный текст
Ответ на CLUSTER and MVCC  (Heikki Linnakangas <heikki@enterprisedb.com>)
Ответы Re: CLUSTER and MVCC  ("Zeugswetter Andreas ADI SD" <ZeugswetterA@spardat.at>)
Список pgsql-hackers
On Fri, 2007-03-09 at 11:29 +0000, Heikki Linnakangas wrote:
> Is there a particular reason why CLUSTER isn't MVCC-safe? It seems to me 
> that it would be trivial to fix, by using SnapshotAny instead of 
> SnapshotNow, and not overwriting the xmin/xmax with the xid of the 
> cluster command.

It's trivial to fix now in this way, but it would break HOT, since an
indexscan only returns one row per index entry.

> I feel that I must missing something, or someone would've already fixed 
> it a long time ago...
> 
> Csaba, you mentioned recently 
> (http://archives.postgresql.org/pgsql-hackers/2007-03/msg00027.php) that 
> you're actually using the MVCC-violation to clean up tables during a 
> backup. Can you tell us a bit more about that? Would you be upset if we 
> shut that backdoor?

On that thread I suggested we add NOWAIT syntax to allow the existing
behaviour to continue, as Csaba requested. The default should be to wait
for other transactions to complete, like CREATE INDEX CONCURRENTLY, when
the command is run outside of a transaction block.

If you do this any other way, you'll need to fix it for HOT.

> In any case, the MVCC-violation needs to be documented. I'll send a doc 
> patch to pgsql-patches shortly.
> 

--  Simon Riggs              EnterpriseDB   http://www.enterprisedb.com




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: CLUSTER and MVCC
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: RFC: changing autovacuum_naptime semantics