Gregory Stark wrote:
>
> "Heikki Linnakangas" <heikki@enterprisedb.com> writes:
>
> > There is one wacky idea I haven't dared to propose yet:
> >
> > We could lift the limitation that you can't defragment a page that's
> > pinned, if we play some smoke and mirrors in the buffer manager. When
> > you prune a page, make a *copy* of the page you're pruning, and keep
> > both versions in the buffer cache. Old pointers keep pointing to the old
> > version. Any new calls to ReadBuffer will return the new copy, and the
> > old copy can be dropped when its pin count drops to zero.
>
> Fwiw when Heikki first mentioned this idea I thought it was the craziest thing
> I ever heard. But the more I thought about it the more I liked it. I've come
> to the conclusion that while it's a wart, it's not much worse than the wart of
> the super-exclusive lock which it replaces. In fact it's arguably cleaner in
> some ways.
I read this as very similar to RCU. In some scenarios it makes a lot of
sense. I don't think it's a thing to be attacked in 8.3 though, since
it is a big change to the bufmgr.
--
Alvaro Herrera http://www.advogato.org/person/alvherre
"The Postgresql hackers have what I call a "NASA space shot" mentality.Quite refreshing in a world of "weekend drag
racer"developers."
(Scott Marlowe)