Re: patch for new feature: Buffer Cache Hibernation - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: patch for new feature: Buffer Cache Hibernation
Date
Msg-id BANLkTikVqbuBdLe+_7u1inV=n9RkrzeqQQ@mail.gmail.com
Whole thread Raw
In response to Re: patch for new feature: Buffer Cache Hibernation  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: patch for new feature: Buffer Cache Hibernation
Re: patch for new feature: Buffer Cache Hibernation
List pgsql-hackers
On Sun, May 15, 2011 at 11:19 AM, Robert Haas <robertmhaas@gmail.com> wrote:

> I don't think there's any need for this to get data into
> shared_buffers at all.  Getting it into the OS cache oughta be plenty
> sufficient, no?
>
> ISTM that a very simple approach here would be to save the contents of
> each shared buffer on clean shutdown, and to POSIX_FADV_WILLNEED those
> buffers on startup.

Do you mean to save the contents of the buffer pages themselves into a
hibernation file, or to save just the identities (relation/fork/block
number) of the buffers?

In the first case, getting them into the OS cache would not help
because the kernel would not recognize that data as being equivalent
to the block it is a copy of.

In the latter case, wouldn't we just trigger the same inefficient
scattered read of the data that normal database operation would
trigger, taking about the same amount of time to reach cache-warmth?
Or is POSIX_FADV_WILLNEED going to be clever about reordering and
coalescing reads?

Cheers,

Jeff


pgsql-hackers by date:

Previous
From: Pavel Golub
Date:
Subject: PQdeleteTuple function in libpq
Next
From: Florian Pflug
Date:
Subject: Re: Another issue with invalid XML values