Re: fix use of posix_fadvise in xlog.c

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: fix use of posix_fadvise in xlog.c
Дата
Msg-id 4C1106CD.6030205@enterprisedb.com
обсуждение исходный текст
Ответ на Re: fix use of posix_fadvise in xlog.c  (Mark Wong <markwkm@gmail.com>)
Ответы Re: fix use of posix_fadvise in xlog.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 10/06/10 18:17, Mark Wong wrote:
> On Jun 9, 2010, at 11:25 PM, Heikki Linnakangas
> <heikki.linnakangas@enterprisedb.com> wrote:
>> I don't think POSIX_FADV_DONTNEED does what you think it does. It
>> tells the kernel that "you don't need to keep these pages in the cache
>> anymore, I won't be accessing them anymore". If you call it when you
>> open the file, before reading/writing, there is nothing in the cache
>> and the call will do nothing.
>
> Oops, my bad. I think I was confused by the short description in the man
> page. I didn't read the longer descriptoon. :( Then would it be worth
> making the this call after the file is zeroed out?

Not sure. If you're churning through WAL files at a reasonable speed, 
the zeroed-out file will soon be written to again. OTOH, we always write 
whole pages, so maybe the OS is smart enough to not read the page back 
to memory just to overwrite it.

In a steady-state situation new WAL files are not created very often 
because we recycle old ones, so it probably doesn't make much difference.

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


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Command to prune archive at restartpoints
Следующее
От: Tom Lane
Дата:
Сообщение: Re: fix use of posix_fadvise in xlog.c