Re: Clarification about HOT - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Clarification about HOT
Date
Msg-id 20071102170420.GD9936@svana.org
Whole thread Raw
In response to Re: Clarification about HOT  ("Gokulakannan Somasundaram" <gokul007@gmail.com>)
List pgsql-hackers
On Fri, Nov 02, 2007 at 10:27:27PM +0530, Gokulakannan Somasundaram wrote:
> 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?

You have to lock (4,5) also to make sure it's still there after you
update. Maybe just at that moment another vacuum saw that (4,5) can
also be cleaned, you have to lock all the pages to make sure the change
is atomic...

As soon as you have to lock more than one page, deadlocks become a
problem.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

pgsql-hackers by date:

Previous
From: "Gokulakannan Somasundaram"
Date:
Subject: Re: Proposal: Select ... AS OF Savepoint
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Proposal: Select ... AS OF Savepoint