Re: online debloatification (was: extending relations more efficiently)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: online debloatification (was: extending relations more efficiently)
Дата
Msg-id 18056.1335991144@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: online debloatification (was: extending relations more efficiently)  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: online debloatification (was: extending relations more efficiently)  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> Brainstorming wildly, how about something like this:

> 1. Insert a new copy of the tuple onto some other heap page.  The new
> tuple's xmin will be that of the process doing the tuple move, and
> we'll also set a flag indicating that a move is in progress.
> 2. Set a flag on the old tuple, indicating that a tuple move is in
> progress.  Set its TID to the new location of the tuple.  Set xmax to
> the tuple mover's XID.  Optionally, truncate away the old tuple data,
> leaving just the tuple header.
> 3. Scan all indexes and replace any references to the old tuple's TID
> with references to the new tuple's TID.
> 4. Commit.

What happens when you crash partway through that?  Also, what happens if
somebody wishes to update the tuple before the last step is complete?

In any case, this doesn't address the fundamental problem with unlocked
tuple movement, which is that you can't just arbitrarily change a
tuple's TID when there might be other operations relying on the TID
to hold still.
        regards, tom lane


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

Предыдущее
От: Daniel Farina
Дата:
Сообщение: Modeling consumed shmem sizes, and some thorns
Следующее
От: Robert Haas
Дата:
Сообщение: Re: online debloatification (was: extending relations more efficiently)