Re: CREATE INDEX and HOT - revised design

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: CREATE INDEX and HOT - revised design
Дата
Msg-id 17356.1174585286@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: CREATE INDEX and HOT - revised design  ("Pavan Deolasee" <pavan.deolasee@gmail.com>)
Ответы Re: CREATE INDEX and HOT - revised design  ("Pavan Deolasee" <pavan.deolasee@gmail.com>)
Список pgsql-hackers
"Pavan Deolasee" <pavan.deolasee@gmail.com> writes:
> When CREATE INDEX starts, it acquires ShareLock on the table.
> At this point we may have one or more HOT-update chains in the
> table. Tuples in this chain may be visible to one or more running
> transactions. The fact that we have ShareLock on the table means
> that all tuples in the chain except the one at the head either
> RECENTLY_DEAD or were UPDATEd by the same transaction
> that is now running CREATE INDEX.

This logic seems pretty questionable to me in view of the recent VACUUM
FULL bug fixes.  We now know that an update chain can contain tuples that
appear DEAD but are later than ones that are RECENTLY_DEAD.  How are
you defining a HOT chain exactly --- will it be just a part of an
update chain that consists only of contiguous tuples that appear live or
RECENTLY_DEAD to the CREATE INDEX transaction?

> In fact, the serializable transactions started before CREATE INDEX
> can not anyway see the index so all this is done to handle
> read-committed transactions.

You are laboring under an illusion that system catalog accesses are MVCC.
SnapshotNow does not behave that way: the system can see the new index
as soon as it's committed.  (It had better, since it has to start
updating the index immediately, whether it's safe to scan it or not.)
I'm not sure whether that's fundamental to your argument or not, but
it's certainly wrong.
        regards, tom lane


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

Предыдущее
От: "Luke Lonergan"
Дата:
Сообщение: Re: TOASTing smaller things
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Bug in CREATE/DROP TABLESPACE command