Re: Clarification about HOT

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Clarification about HOT
Дата
Msg-id 472B593E.4040408@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Clarification about HOT  ("Gokulakannan Somasundaram" <gokul007@gmail.com>)
Список pgsql-hackers
Gokulakannan Somasundaram wrote:
> Thanks Heikki.  I am still not getting what you said. In the case of HOT,
> you need to update the top pointer to point to some other tuple in some
> other page. That's one update. what's the other one?
> 
> say currently the top of heap chain points to (2,3) . Imagine we are making
> the HOT chain through the pages. there might be a situation it should start
> pointing to (4,5) after the tuple at (2,3) gets ready to be Vacuumed. We
> should just lock the page where the top of HOT chain resides and update it
> to point to (4,5). What else we should do atomically?

Imagine one more update, and we end up with a HOT chain like this:

(2,3) -> (4,5) -> (6,7)

Where (2,3) is a redirecting line pointer, (4,5) is a tuple that can be 
vacuumed, and (6,7) is the a live tuple. When vacuuming (4,5), the 
redirecting line pointer (2,3) needs to be updated at the same time.

The chain could be even longer, requiring either locking and modifying 
even more pages atomically, or doing the pruning in steps which leads to 
more WAL traffic among other things.

It could be done, we already have to deal with locking two pages 
simultaneously in heap_update, but it's pretty darn complex.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Proposal: Select ... AS OF Savepoint
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: minimal update