Re: Visibility map thoughts - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Visibility map thoughts
Date
Msg-id 473071BA.30407@enterprisedb.com
Whole thread Raw
In response to Re: Visibility map thoughts  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: Visibility map thoughts  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark wrote:
> "Heikki Linnakangas" <heikki@enterprisedb.com> writes:
> 
>> One problem is that you have to atomically update the visibility map when
>> you update the heap. That means that you have to lock the visibility map
>> page and the heap page at the same time. If the visibility map is in the
>> heap, you need to take care that you don't deadlock.
> 
> Well that's still a problem if it's in another filenode.
> 
> On the other hand if you allocate a whole byte to every page you could set it
> atomically and not have to lock the page. Effectively having the lock on the
> original page protect the info byte. Whereas setting a single bit requires
> protecting against someone setting one of the other bits corresponding to
> another page entirely.

I don't buy that. I believe at least on some architectures you'd get a 
word-long load+modify+store, and scribble the neighboring bytes.

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


pgsql-hackers by date:

Previous
From: "Marko Kreen"
Date:
Subject: Re: Visibility map thoughts
Next
From: Simon Riggs
Date:
Subject: Re: Visibility map thoughts